Results 1 to 8 of 8

Thread: combo change doesn't work as I want

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    TURKEY
    Posts
    37
    I replace a combo box on my form ...

    I want one event to trigger

    When I chosee a different value from combo .

    I write my code in "myCombo_Change()" event ...
    but it is not triggered When I chosee a different value from combo .
    it triggered when I write something to mycombo..

    thanks

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879
    show me your code for on Change event
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    TURKEY
    Posts
    37

    it just a message (yet)

    it just a message (yet) as fallowing
    msgbox "mycombo change"

    but if I can take this message

    I use if then
    ......
    else
    .....
    end if
    or select case
    structure to do something more...


  4. #4
    Addicted Member
    Join Date
    Jan 1999
    Posts
    204
    you have to put it under click not change because you are clicking the combo box and not change it got it
    WHat would we do with out Microsoft.
    A lot more.

  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    TURKEY
    Posts
    37

    I understood you but....

    I understood you but "click event" occurs even if I doesn't change combo box value.

  6. #6
    Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    52
    Are you only chosing from the combo list?. If so then change the style property to '2-drop down list' and the click event 'will' fire when you choose an item.

  7. #7

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    TURKEY
    Posts
    37

    thanks but....

    I did what you said...

    But still "click event" occurs even if
    i doesn't change combo box value.

    I can control change event in my code...

    But I doesn't want to do that .
    I want a event which only occure
    when I choose different value then before in my combo...

    example
    my combo contains

    item1
    item2
    item3

    first item2 heve chosen
    then I change to item3
    my event must be triggered. (click event do it properly)
    but when item2 is chosed from list again
    my event mustn' be triggered. (click event occurs . But it
    must not occur )


















  8. #8
    Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    52
    This is what I have done to avoid having the initial click fired when the text of the combo is set.

    When you are initially populate the combo box set the tag property to what the text property will be

    ex. dim search = 1 to 10
    combo1.additem search
    next search
    combo1.tag = combo1.list(4)
    combo1.text = combo1.list(4)

    And the in the click event of the combo do a comparison

    combo1_Click
    if combo1.text <> combo1.tag then
    'do what you want done as text has changed
    end if
    end sub



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width