Windows Develop Bookmark and Share   
 index > Windows Forms General > disable default / automatic tooltip .
 

disable default / automatic tooltip .

Hi all. (I resubmit this question , first try was no good).

I’m using .Net 2.0 and the question is about tooltips.

I’m assigning tooltip for each treenode in a treeview control by using a tooltip and call manually the show and hide methods to manipulate it (on the treeview mouse move event handler).

When I have a long name node that spills over the form �I’m getting the “automatic�tooltip with the name of the node. The result is that I’m getting 2 tooltips for the same node (mine and the automatic one). This is reproducible with a simple standalone tree and a lond named node.

How can I disable the automatic one (setting the ShowNodeTooltips property of the treeview doesn’t effect it) ?

I wonder how one can control this “auto tooltip�properties.

I’m missing something ?

I did look at this post which is similar but with no answer �yet �

Thanks

Amit

AllUsernamesAreTaken  Tuesday, June 03, 2008 7:38 PM
Add a new class to your project and paste this code:

using System;
using System.Windows.Forms;

public class MyTreeView : TreeView {
protected override CreateParams CreateParams {
get {
CreateParams parms = base.CreateParams;
parms.Style |= 0x80; // Turn on TVS_NOTOOLTIPS
return parms;
}
}
}

Compile. Drag + drop the new control from the top of the toolbox onto your form.
nobugz  Wednesday, June 04, 2008 1:59 AM
You'd have to look at the MSDN library pages for the native TreeView control. TVS_NOTOOLTIP is declared in the commctrl.h SDK header file.
nobugz  Wednesday, June 04, 2008 2:27 PM
Add a new class to your project and paste this code:

using System;
using System.Windows.Forms;

public class MyTreeView : TreeView {
protected override CreateParams CreateParams {
get {
CreateParams parms = base.CreateParams;
parms.Style |= 0x80; // Turn on TVS_NOTOOLTIPS
return parms;
}
}
}

Compile. Drag + drop the new control from the top of the toolbox onto your form.
nobugz  Wednesday, June 04, 2008 1:59 AM

Thanks nobugz , this is working !

Naturally I tried to find more available options (this createparam and style are new to me) but the only list I found was in the winuser.h file (got there from here ) which is incomplete (the TVS_TOOLTIP you showed me is missing ) and is missing documentation.

Do you know a source of documentation for these options ?

Thanks again for your help

Amit

AllUsernamesAreTaken  Wednesday, June 04, 2008 2:22 PM
You'd have to look at the MSDN library pages for the native TreeView control. TVS_NOTOOLTIP is declared in the commctrl.h SDK header file.
nobugz  Wednesday, June 04, 2008 2:27 PM

Thanks again.

Amit

AllUsernamesAreTaken  Wednesday, June 04, 2008 2:46 PM

You can use google to search for other answers

Custom Search

More Threads

• .NET Framework 3.0 development on VB2005EE
• how to make a property for enum ?
• Insert a Resourse to textbox?
• HTML to image
• Need suggestion...
• paste transparent images to clipboard
• How to change datagridview row backcolor
• Printing scrollable ListView with PrintForm component
• Image acquisition through VB .NET
• Passing a Parameter in a DataGrid ButtonColumn