|
-
Nov 4th, 2000, 06:41 AM
#1
Thread Starter
Member
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
-
Nov 4th, 2000, 07:05 AM
#2
Fanatic Member
show me your code for on Change event
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Nov 4th, 2000, 07:23 AM
#3
Thread Starter
Member
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...
-
Nov 4th, 2000, 07:38 AM
#4
Addicted Member
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.
-
Nov 4th, 2000, 07:43 AM
#5
Thread Starter
Member
I understood you but....
I understood you but "click event" occurs even if I doesn't change combo box value.
-
Nov 4th, 2000, 08:23 AM
#6
Member
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.
-
Nov 4th, 2000, 08:58 AM
#7
Thread Starter
Member
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 )
-
Nov 4th, 2000, 01:45 PM
#8
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|