Highlight in Tree view

  • Thread starter Thread starter sureshsmani
  • Start date Start date
S

sureshsmani

In the tree view, if the size of the text is longer than the size of the
control and the mouse is hovered on a item, the item is displayed in full
with a yellow highlight. Is is possible to disable that feature in the tree
view.

Suresh S.
 
You need to override it like this:

Public Class TreeViewEx
Inherits TreeView
Private Const TVS_NOTOOLTIPS As Integer = &H80
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim params As CreateParams = MyBase.CreateParams
params.Style = params.Style Or TVS_NOTOOLTIPS
Return params
End Get
End Property
End Class

/claes
 
It worked. Thanks for you help.


Claes Bergefall said:
You need to override it like this:

Public Class TreeViewEx
Inherits TreeView
Private Const TVS_NOTOOLTIPS As Integer = &H80
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim params As CreateParams = MyBase.CreateParams
params.Style = params.Style Or TVS_NOTOOLTIPS
Return params
End Get
End Property
End Class

/claes
 
not sure why you'd want to disable that and make it harder to read? but that
is called a tooltip for future reference
 
Back
Top