|
-
Jun 22nd, 2004, 12:04 PM
#1
Thread Starter
New Member
mouse leave
I am using mouse enter/leave to change the back colour of a button. Clicking the button hides the form. When the form is re-displayed mouse enter/leave do not work. I am guessing that this is because the mouse leave event wasn't triggered when the form was hidden. If so is there any way to trigger this event ?
-
Jun 23rd, 2004, 12:41 AM
#2
Fanatic Member
i don't know much about what are you doing. but i have this and it works.
VB Code:
'in form1
dim f as new form2
sub button1_click(sender as object,e as eventargs) handles button1.click
f.show()
end sub
'and in form2
sub button1_mouseenter(sender as object,e as eventargs) handles button1.mouseenter
button1.backcolor=color.brown 'monkey, lol
end sub
sub button1_mouseleave(sender as object, e as eventargs) handles button1.mouseleave
button1.backcolor=nothing
end sub
sub bb(sender as object,e as eventargs) handles button1.click
me.hide()
end sub
hope i don't bark a wrong tree...
-
Jun 23rd, 2004, 04:24 AM
#3
Thread Starter
New Member
Thanks brown monkey. If you replace f.show with f.showdialog in your code then mouse enter/leave only work the first time form2 is displayed. Can anyone explain why this is ?
-
Jun 23rd, 2004, 04:46 AM
#4
Fanatic Member
i don't know much about this but i think it has to do with the instantiation. put dim f as new form2() inside the button click event along with the .showdialog(). it works.
-
Jun 23rd, 2004, 11:40 AM
#5
Thread Starter
New Member
thanks, i agree this works. however i am using a public statement in a module, not a dim statement, for the form. so i am looking for an alternative solution.
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
|