''make our tooltip window a topmost window
SetWindowPos m_lttHwnd, _
HWND_TOPMOST, _
0&, _
0&, _
0&, _
0&, _
SWP_NOACTIVATE Or SWP_NOSIZE Or SWP_NOMOVE
''get the rect of the parent control
GetClientRect UserControl.hWnd, lpRect
''now set our tooltip info structure
With ttip
''if we want it centered, then set that flag
If m_lttCentered Then
.lFlags = TTF_SUBCLASS Or TTF_CENTERTIP
Else
.lFlags = TTF_SUBCLASS
End If
''set the hwnd prop to our parent control's hwnd
.lhWnd = UserControl.hWnd
.lId = 0
.hInstance = App.hInstance
'.lpstr = ALREADY SET
.lpRect = lpRect
End With
''add the tooltip structure
SendMessage m_lttHwnd, TTM_ADDTOOLA, 0&, ttip
''if we want a title or we want an icon
If m_sTooltipTitle <> vbNullString Or m_lToolTipIcon <> TTNoIcon Then
SendMessage m_lttHwnd, TTM_SETTITLE, CLng(m_lToolTipIcon), ByVal m_sTooltipTitle
End If
If m_lttForeColor <> Empty Then
SendMessage m_lttHwnd, TTM_SETTIPTEXTCOLOR, TranslateColor(m_lttForeColor), 0&
End If
If m_lttBackColor <> Empty Then
SendMessage m_lttHwnd, TTM_SETTIPBKCOLOR, TranslateColor(m_lttBackColor), 0&
End If