|
Standardmäßig zeigen alle TreeView-Steuerelemente der Microsoft
Common Controls ab Version 4.70 den Text eines Knotens
als Tooltip unter dem Mauszeiger an, wenn der Text nicht
vollständig sichtbar ist. Dieses Eigenschaft können Sie über das
Setzen bzw. Löschen des entsprechenden Fensterstils ein oder
ausschalten.
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) _
As Long
Private Const TVS_NOTOOLTIPS = &H80
Private Const GWL_STYLE = (-16)
Public Sub TvwShowToolTips(TreeView As TreeView)
Dim nStyles As Long
With TreeView
nStyles = GetWindowLong(.hwnd, GWL_STYLE)
nStyles = nStyles And (Not TVS_NOTOOLTIPS)
SetWindowLong .hwnd, GWL_STYLE, nStyles
End With
End Sub
Public Sub HideToolTips(TreeView As TreeView)
Dim nStyles As Long
With TreeView
nStyles = GetWindowLong(.hwnd, GWL_STYLE)
nStyles = nStyles Or TVS_NOTOOLTIPS
SetWindowLong .hwnd, GWL_STYLE, nStyles
End With
End Sub
|