General programming

Moderators: None (Apply to moderate this forum)
Number of threads: 1642
Number of posts: 2791

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
using mousemove properties Posted by thegreenstar on 15 Jun 2003 at 12:29 AM
How does the Form_MouseMove sub work? Say I wanted Frame1.visible = true whenever the X coordinate of the mouse is >= 8 and <= 32, and the Y coordinate >= 8 and <= 32, how would I do that?

Better yet, is there something like Private Sub Img1_Hover()? That will run as long as the user has the mouse hovering over Img1?
Report
Re: using mousemove properties Posted by Keilor on 16 Jun 2003 at 12:38 AM
The MouseMove event triggers whenever the mouse is moved over the object so it's relatively simple to have something happen whenever the mouse pointer is over an object. Try the following:

Place a command button, a list box and a label on a form and add the following code:

Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label1.Caption = "Command 1"
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label1.Caption = ""
End Sub

Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label1.Caption = "List 1"
End Sub


Move the mouse over the button and the list box. The label will change to show whether the mouse is over the command button or the list box. When the mouse is over the form the label is blank.

Keilor.


: How does the Form_MouseMove sub work? Say I wanted Frame1.visible = true whenever the X coordinate of the mouse is >= 8 and <= 32, and the Y coordinate >= 8 and <= 32, how would I do that?
:
: Better yet, is there something like Private Sub Img1_Hover()? That will run as long as the user has the mouse hovering over Img1?
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.