Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Mouse Enter or Mouse Leave Event in VB

Posted on 1999-09-26
5
Medium Priority
?
356 Views
Last Modified: 2010-05-02
How do i find out the Mouse Enter or Mouse Leave from the Control where mouse point over on it (Like Developer 2000)?
0
Comment
Question by:ghouse75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 80 total points
ID: 2075721
In the form's general declaration area, add:

  Private Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
  Private Declare Function ReleaseCapture Lib "user32" () As Long

In the MouseMove Event of the control, add

Dim MouseOver As Boolean
' See if the mouse is over
MouseOver = (0 <= X) And (X <= Command2.Width) And (0 <= Y) And (Y <= Command2.Height)

If MouseOver Then
 MouseOver is true
        ' Do something
        SetCapture Command2.hWnd
  Else
   ' Mouse Left
         'Do something else
         ReleaseCapture
 End If
0
 
LVL 10

Expert Comment

by:viktornet
ID: 2076845
interesting...
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2077268
Yep, saw this myself recently. Good tip.

See also Karl Petersen's article in the VBPJ of... damn... forgot... twas recent anyway, August or something, or one of the recent special releases.
0
 

Author Comment

by:ghouse75
ID: 2077395
I need the uses of SetCapture and ReleaseCapture API funtion on your mousemove enent
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6862046
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp

In efforts to help all Members maintain their open questions, this is a reminder to click your Member Profile, expand your question history and find/update all your Open and Locked questions.
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question