Combobox Change event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muddasirmunir
    Contributor
    • Jan 2007
    • 284

    Combobox Change event

    I am using vb6.

    I want to solve one problem to define clearly i will use a simple example.

    Take a form and put a combobox in it



    Code:
    Private Sub Form_Load()
    Combo1.AddItem "Apple"
    Combo1.AddItem "Banana"
    Combo1.AddItem "orange"
    Combo1.AddItem "Lemon"
    End Sub
    and on change event



    Code:
    Private Sub Combo1_Change()
    MsgBox Combo1.Text
    End Sub
    Now select differenct name like banana and orange with mouse or arrow keys but you will not get any message,why change event is not accuring when we change name and on what event we will get message as we select different name.

    i want that when i change the name it will prompt/message me the selected name.
    Last edited by pbmods; Jan 14 '09, 11:36 PM. Reason: Added CODE tags.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to use the Click event of the control.

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Hi,

      Change Event is Fired only when Style=0 or 1 and text in the text box portion of the control changes.
      So, as Debasis told, you need to write the code in Click event.

      Regards
      Veena

      Comment

      Working...