How can I change the listIndex of a combobox while cursor is placed on text of different font sizes like in microsoft word?
Change the listindex of a combobox
Collapse
X
-
-
Well I'm using a combobox for changing font size. When i run my program the value shown in combobox is 10(because i have set the listindex as equal to that value. When i change the font size to e-g 48 the value shown in combobox is 48. I want that when i place cursor on text of different font sizes, the value of combo box also change accordingly. I have done this by adding following code to SelChange event of rtb
Private Sub rtfText_SelChan ge()
If Not IsNull (rtfText.SelFon tSize) Then
frmMain.cmbFont Size.Text = rtfText.SelFont Size
End If
End Sub
.Comment
-
Thanks Yuleball for the code. You can do one more thing vice versa. Suppose textbox is empty and combo has some font sizes. When u select a font size in combo it can be filled in textbox. In Click event of combo place code something like this
Text1.Text=Text 1.Text+vbKeyRet urn+combo1.Text
May be it will u further.Comment
Comment