VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

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

10Tec Company  (5 Submissions)   Miscellaneous   Visual Basic 5.0   Beginner   Wed 3rd February 2021

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) (13(13 Vote))

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

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

No comments yet — be the first to post one!

Post a Comment

0/1000 characters