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

Next revision
Previous revision
displaying_20a_20tooltip_20on_20demand [2018/03/31 13:19] – external edit 127.0.0.1displaying_20a_20tooltip_20on_20demand [2024/01/05 00:22] (current) – external edit 127.0.0.1
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.1522502356.txt.gz · Last modified: 2024/01/05 00:18 (external edit)