Hi all,
Maybe a simple question: How can I create a tooltiptext that consists of multiple
lines? I tried in the example below with a simple $CR (carriage return) but this does
not work. $CRLF also does not work..
Kind regards
Eddy
------------------
[email protected]
Maybe a simple question: How can I create a tooltiptext that consists of multiple
lines? I tried in the example below with a simple $CR (carriage return) but this does
not work. $CRLF also does not work..
Kind regards
Eddy
Code:
#COMPILE EXE OPTION EXPLICIT #INCLUDE "win32api.inc" #INCLUDE "CommCtrl.Inc" GLOBAL ti AS TOOLINFO GLOBAL hDlg AS LONG GLOBAL hWnd_ToolTip AS LONG DECLARE SUB SetToolTipText(BYVAL id AS LONG, ttxt AS ASCIIZ * 50) FUNCTION PBMAIN DIM i AS LONG InitCommonControls hWnd_ToolTip = CreateWindowEx( 0, "tooltips_class32", "", %TTS_ALWAYSTIP, 0, 0, 0, 0, 0, _ BYVAL 0&, GetModuleHandle(BYVAL 0&), BYVAL 0&) DIALOG NEW 0, "Tooltip example",,, 400, 40, %WS_CAPTION OR %WS_SYSMENU TO hDlg CONTROL ADD BUTTON, hDlg, 101, "PROGRAM", 5, 5, 25, 25 SetToolTipText 101, "This is a tooltip" & $CR & "Hoped this would be on another line.." CONTROL ADD BUTTON, hDlg, 102, "TOOLBAR", 45, 5, 350, 25 SetToolTipText 102, "Another tooltip !" DIALOG SHOW MODAL hDlg END FUNCTION SUB SetToolTipText(BYVAL id AS LONG, ttxt AS ASCIIZ * 50) ti.cbSize = LEN(ti) ti.uFlags = %TTF_SUBCLASS OR %TTF_IDISHWND ti.hWnd = hDlg ti.uId = GetDlgItem(hDlg, id) ti.lpszText = VARPTR(ttxt) SendMessage hWnd_ToolTip, %TTM_ADDTOOL, 0, BYVAL VARPTR(ti) END SUB
------------------
[email protected]
Comment