User Tools

Site Tools


displaying_20a_20tooltip_20on_20demand

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

displaying_20a_20tooltip_20on_20demand [2018/03/31 13:19]
127.0.0.1 external edit
displaying_20a_20tooltip_20on_20demand [2018/04/16 14:48] (current)
richardrussell Added syntax highlighting
Line 1: Line 1:
 =====Displaying a tooltip on demand===== =====Displaying a tooltip on demand=====
  
-//by Richard Russell, August 2012//\\ \\  As a rule, a **tooltip** is displayed when the mouse moves into the tool's //​rectangle//​ and stays there for a specified minimum period of time; typically this is when the user '​hovers'​ the mouse over a control or other region of interest. However it is also possible to force a tooltip to display 'on demand',​ under the control of your program.\\ \\  The code listing below demonstrates how to do that:\\ +//by Richard Russell, August 2012//\\ \\  As a rule, a **tooltip** is displayed when the mouse moves into the tool's //​rectangle//​ and stays there for a specified minimum period of time; typically this is when the user '​hovers'​ the mouse over a control or other region of interest. However it is also possible to force a tooltip to display 'on demand',​ under the control of your program.\\ \\  The code listing below demonstrates how to do that: 
 + 
 +<code bb4w>
         INSTALL @lib$+"​WINLIB5"​         INSTALL @lib$+"​WINLIB5"​
  
Line 48: Line 50:
         SYS "​SendMessage",​ hwndTT%, TTM_UPDATETIPTEXT,​ 0, ToolInfo{}         SYS "​SendMessage",​ hwndTT%, TTM_UPDATETIPTEXT,​ 0, ToolInfo{}
         ENDPROC         ENDPROC
 +</​code>​
 +
 As shown, clicking anywhere will cause a **balloon tooltip** (available in Windows XP or later) to be displayed at the mouse position, and to remain displayed for one second. If the **TTS_BALLOON** style is omitted a regular tooltip will be displayed. As shown, clicking anywhere will cause a **balloon tooltip** (available in Windows XP or later) to be displayed at the mouse position, and to remain displayed for one second. If the **TTS_BALLOON** style is omitted a regular tooltip will be displayed.
displaying_20a_20tooltip_20on_20demand.txt · Last modified: 2018/04/16 14:48 by richardrussell