?
Solved

how to detect the mouse leave?

Posted on 1998-08-29
4
Medium Priority
?
152 Views
Last Modified: 2010-04-30
using vb4. Show tool tip when the mouse is over. however, if the mouse leaves a control quickly, the tooltip is still there. Any way to know when the mouse leave?
0
Comment
Question by:bobhshaw
[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
4 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 800 total points
ID: 1431793
bobhshaw,
Try this, let me know if you have any questions.
Regards
Dalin

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
 

Author Comment

by:bobhshaw
ID: 1431794
Thank you.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1431795
Bought This Question.
0
 
LVL 10

Expert Comment

by:smegghead
ID: 2660133
Could someone tell me what the 'SetCapture' api does ??
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

741 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