Mouse Move on Label
-
I have two label1 and label2 on form by default label2.visible=False. when mouse move on label1 then label2.visible=True, else if mouse is not on label1(or over any other control) then label2.visible=False what should i do to set visibility of label2 to False if mouse is not over label1, help please
-
I have two label1 and label2 on form by default label2.visible=False. when mouse move on label1 then label2.visible=True, else if mouse is not on label1(or over any other control) then label2.visible=False what should i do to set visibility of label2 to False if mouse is not over label1, help please
-
there isn't any MouseEntry or MouseLeave events with label1 or 2. i am using vb6
-
there isn't any MouseEntry or MouseLeave events with label1 or 2. i am using vb6
You should have mentioned you were using VB6 in your original post. If you don't, everyone assumes you're using VB.NET. There is no equivilent event in VB6. The closeest you're going to get is MouseMove, but you cannot tell if the mouse has left the label control, only when the mouse is moving on the label control.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
there isn't any MouseEntry or MouseLeave events with label1 or 2. i am using vb6
-
there isn't any MouseEntry or MouseLeave events with label1 or 2. i am using vb6
Tufail Ahmad wrote:
there isn't any MouseEntry or MouseLeave events with label1 or 2.
There's a MouseMove that get's triggered when the mouse moves over the label - you could abuse that to simulate the events. Add a boolean value, and set it to "true" the first time that the
MouseMove
event fires. That would be the equivalent of aMouseEnter
event. Clear the boolean again when there's a MouseMove on the main form, or if you didn't receive aMouseMove
in the last two seconds; that's yourMouseLeave
event :)I are Troll :suss: