VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Adding real Win32 tooltips for windowless controls (Label, Image, etc)

by 10Tec Company (5 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (12 Votes)

The attached code demonstrates an idea you can use to create real Win32 tooltips for windowless controls. The problem with Win32 tooltips is that you can attach it only to a control that provides the hwnd property returning the Win32 handle of the control. Some VB intrinsic controls such as Label do not have the hwnd property. The following trick allows you to create real Windows tooltips for these controls.
To do it, simply determine the moment when the mouse pointer has entered the area occupied by the required control, and create a tooltip for the FORM that contains the control. You need to detach the created tooltip from the form when the mouse pointer has left the control area; you can do it in the Form_MouseMove method.
The attached example shows how to create a multiline balloon tooltip for a Label control. Using this technique, you can create tooltips for any control that implements the MouseMove event (for instance, for Image control too).

Rate Adding real Win32 tooltips for windowless controls (Label, Image, etc)

Download Adding real Win32 tooltips for windowless controls (Label, Image, etc)

Download Adding real Win32 tooltips for windowless controls (Label, Image, etc) (4 KB)

Adding real Win32 tooltips for windowless controls (Label, Image, etc) Comments

No comments have been posted about Adding real Win32 tooltips for windowless controls (Label, Image, etc). Why not be the first to post a comment about Adding real Win32 tooltips for windowless controls (Label, Image, etc).

Post your comment

Subject:
Message:
0/1000 characters