TreeView tooltip

gallicus
12-12-2001, 04:53 AM
Hi,
I have a treeview control, containing parent and child nodes. I have not set the ToolTipText property of the treeview to contain any text. The parent node does not display any ToolTipText, however the child nodes do display what appears to be a ToolTipText. The ToolTipText contains the text which comprises the text of the child node itself. I want to get rid of this ToolTipText as it is not necessary for my purpose. Any ideas? Thanx in advance
Gallicus

Ad1
12-12-2001, 05:05 AM
if your treeview is wide enough that the text is totally visible then you should have no tooltiptext appear

gallicus
12-12-2001, 05:34 AM
Thanks! That has sorted it.

Atze
02-26-2005, 01:30 PM
Old topic that i found here. ;)

I have the same problem.
But in my case it's not always possible to have the treeview-control wide enough.
So i get those 'tooltips' always and thats very annoying.
Would it be somehow possible, to supress them?
Or maybe to supress them for a short time, so that they only appear if the user whiles a given amount of time before they are displayed?

Currently it looks terrible, when the user moves the mouse over the tree.
He gets nuts of all those 'tooltips'.

Maybe with some kind of subclassing?
But i must say, that i'm not deep in this subclassing-topics. ;)

I hope it's not impossible a all.

Regards,
Atze

Edit:
I found it meanwhile. If anyone is interested, here is some samplecode i found: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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum