Change the listindex of a combobox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yuleball
    New Member
    • Nov 2008
    • 15

    Change the listindex of a combobox

    How can I change the listIndex of a combobox while cursor is placed on text of different font sizes like in microsoft word?
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    you can use the text property for that .

    Comment

    • rpicilli
      New Member
      • Aug 2008
      • 77

      #3
      Hi could you please reformulate your question. I don't understand.

      Excuse me by that.

      Rpicilli

      Comment

      • yuleball
        New Member
        • Nov 2008
        • 15

        #4
        its ok. i have found the solution

        Comment

        • smartchap
          New Member
          • Dec 2007
          • 236

          #5
          Dear
          Actually ur question was not clear. However when u have found the solution please post exact question with solution so that others also understand it.

          Comment

          • yuleball
            New Member
            • Nov 2008
            • 15

            #6
            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

            • smartchap
              New Member
              • Dec 2007
              • 236

              #7
              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

              Working...