Click to See Complete Forum and Search --> : rich text box


sheldon_lobo
August 8th, 2001, 12:38 AM
I have 1 Rich Text Box control on a form.

I have 1 combo box on the same form. This combo contains font-size values. Whenever any text is selected from the RichTextBox, & font-size is selected from this combo , it changes the font-size of the selected text.

The highlight on the selected text in the Rich Text Box is maintained before & after the click of the fontstyle combo.

But the problem is , at the point of selection of font-size from the combo, the highlight on the text in the rich text box is lost. How can i still maintain a highlight on the selected text in the Rich Text Box, even at the point of selection of font-size from the combo.

the following is the code i have used:--

Option Explicit



Private Sub Form_Load()

Dim j As Integer



With cmbFontSize

For j = 8 To 72 Step 2
.AddItem j
Next j


End With


End Sub


Private Sub cmbFontSize_Click()


rtfData.SelFontSize = cmbFontSize.Text
rtfData.SetFocus
End Sub

makai
August 8th, 2001, 10:37 PM
actually all your text still is selected - It's just the way VB shows that that box is no longer in focus

your code ran fine here with no modification