|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
How can i use the mouse OFF event in visual basic? Hello! How can i use the mouse OFF event in visual basic? |
#2
| |||
| |||
Re: How can i use the mouse OFF event in visual basic? For your "mouse off event" the following code tells the object to move to an x position of 100 on roll out (roll out is the correct mouse off) obviously you will have to change the properties to make your button do what you want it to do. Code: //attach this code directly onto your button on(rollOut){ this._x = 100; } Code: //attach this code to the timeline on a locked layer named actions this.yourbutton_btn.onRollOut = function(){ this._x = 100; } |
#3
| |||
| |||
Re: How can i use the mouse OFF event in visual basic? Unless VB.Net has a mouse off event (which it might, I don't know), The answer is "there isn't one". I know VB6 doesn't have one. The only way to find out if the mouse has gone off the form is to use an api call. You need to use the getcursorpos api, and pass it the POINTAPI Type. This will effectively give you the current X Y coordinates of the mouse. Then, you get the current X, Y coordinates of your form (maybe using getwindowrect, with type RECT), and then compare to see if the mouse falls within those boundaries. If it is within those boundaries, the mouse is on the form. If it's not, then it isn't. So you could use a timer control, and check every millisecond where the mouse is. As long as it's on your form, set a variable to true. When it leaves your form, set it false, and execute some kind of "off form" code. Another option, is to set a global hook on the mouse, and whenever you recieve a WM_MOUSEMOVE, check it's coordinates, compare, and execute. |
![]() |
|
Tags: mouse off event, visual basic |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Event and Exception Changes for Visual Basic 6? | jhon | Software Development | 4 | 27-02-2010 06:59 AM |
what are Visual Basic IDE? | Naresh Modi | Software Development | 2 | 06-03-2009 09:49 AM |
Is GUI same like Visual Basic ? | Caesar | Software Development | 2 | 02-03-2009 01:32 PM |
Visual Basic 2005 or Visual Basic 6 | Aasha | Software Development | 5 | 15-01-2009 06:56 PM |
Visual Basic on LAN | djbbenn | Software Development | 2 | 05-08-2008 02:15 PM |