The standard tooltips are too long to fit the dialog! Hours of searching have got me nowhere. Can anyone advise on how this is done please?
Announcement
Collapse
No announcement yet.
multiline tooltips on a listview
Collapse
X
-
I add the tooltips to all controls with CreateWindowEx...
Code:'====================================================================================================================== ' AddToolTips + EnumChildProc: Adds tooltips to a window '---------------------------------------------------------------------------------------------------------------------- Function EnumChildProc(ByVal CtrlDlg As Long, param As Long) As Long Local lTI As TOOLINFO, lZStr As Asciiz * 128, lRect As RECT GetClassName CtrlDlg, lzStr, SizeOf(lzStr) lTI.cbSize = SizeOf(lTI) lTI.uFlags = %TTF_IDISHWND Or %TTF_SUBCLASS lTI.hwnd = hDlg lTI.uID = CtrlDlg lTI.hInst = SI.dwInst lTI.lpszText= %LPSTR_TEXTCALLBACK SetRect lRect, 5,5,100,50 lTI.rec = lrect SendMessage hTTip, %TTM_ADDTOOL, 0, VarPtr(lTI) Function = 1 End Function '---------------------------------------------------------------------------------------------------------------------- Function AddToolTips (ByVal hDlg As Long) As Long hTTip = CreateWindowEx (0, _ "tooltips_class32", _ ByVal %NULL, _ %WS_POPUP Or %TTS_ALWAYSTIP, _ %CW_USEDEFAULT, _ %CW_USEDEFAULT, _ %CW_USEDEFAULT, _ %CW_USEDEFAULT, _ ByVal hDlg, _ ByVal %NULL, _ GetWindowLong (hDlg, %GWL_HINSTANCE), _ ByVal %NULL) If hTTip = %FALSE Then Function = 0 : Exit Function Function = EnumChildWindows (hDlg, CodePtr(EnumChildProc), 0) SendMessage hTTip, %TTM_SETMAXTIPWIDTH, 0, 200 End Function
Regards,
Peter
"Simplicity is a prerequisite for reliability"
Comment
Comment