We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Mnemonics and the Tree control

Thread ID:





51185 Oct 31,2006 12:28 AM UTC Nov 7,2006 11:51 PM UTC WinForms 9
Tags: Tools
Bob Walker
Asked On October 31, 2006 12:28 AM UTC

If the node.text is too long to be displayed, the tooltip that is displayed converts any "&" characters to underscore. A node name such as "Profit & Loss" appears as "Profit Loss" in the tooltip. Is there a UseMnemonic property I can set on the tree to force the "&" to be displayed in the node tooltip?

Malarvizhi [Syncfusion]
Replied On October 31, 2006 05:55 AM UTC

Hi Bob,

Sorry for the inconvenience caused. We were able to reproduce the issue here.

I have attached the sample, please go through that and let me know if i understood you correctly.



Murugan [Syncfusion]
Replied On October 31, 2006 06:17 PM UTC

Hi Bob,

Sorry for the inconvenience caused. We were able to reproduce the issue here. If you are using TreeNodeAdv.HelpText for displaying tooltip, Please change the helptext as TreeNodeAdv.HelpText = "Profit && Loss" and let me know the results.

Murugan P.S

Administrator [Syncfusion]
Replied On October 31, 2006 08:49 PM UTC

I tried adding the following line of code immediately after I set the Node.Text property.

Node.HelpText = Node.Text.Replace("&","&&")

The result now is that if the tree control is wide enough that the entire node text is displayed then a "tooltip" is shown with the single ampersand character displayed correctly. The problem though is that if the tree control width is small enough to prevent the entire node text from being displayed, when I mouseover the node I get 2 separate tooltips popping up:
1) The first one still shows no "&" character - this tooltip seems to be displayed automatically by the tree without me requesting it.
2) The second tooltip (shown below the #1) seems to be generated based on me setting the .HelpText property (because it doesn't show up if I don't set that property). It shows correctly with one "&" character.

The .HelpText property looks like it will resolve my problem if I can find out how to prevent the default tooltip from appearing (when the entire node text can't be displayed because the tree is not wide enough).

Murugan [Syncfusion]
Replied On October 31, 2006 10:22 PM UTC

Hi Bob,

TreeViewAdv control's default tooltip can be made invisible by cancelling the BeforePopUp event.

private void treeViewAdv2_ToolTipControl_BeforePopup(object sender, CancelEventArgs e)
e.Cancel = true;

Please try this code and let me know if you have any other issues.

Murugan P.S

Administrator [Syncfusion]
Replied On November 3, 2006 11:18 PM UTC

Ok - in VB, I've tried declaring:

Private WithEvents TreeTooltip as new ToolTipAdv(MyTree)

where MyTree is the name of the TreeViewAdv control on my form.

I've added e.Cancel = True to the TreeTooltip.BeforePopup event, but the event doesn't fire. If I put a watch on my variables, MyTree.ToolTipControl is not the same object as TreeTooltip. Can you give me a code sample (VB) to correctly define my ToolTipAdv variable and associate it with my tree so the BeforePopup event fires?

Gopalakrishnan S [Syncfusion]
Replied On November 4, 2006 12:53 AM UTC


I have created a sample in VB.NET and attached here. Please refer the attachment sample.


Let me know if this works.


Administrator [Syncfusion]
Replied On November 7, 2006 09:19 PM UTC

Thanks for the sample - I have it working now. One last cosmetic question - the default node tooltip (which is now disabled) was displayed with a standard yellow background. The Node.HelpText tooltip is displayed with a different color background - a dirty brown/yellow shade. Is there a way I can get the Node.HelpText tooltip to display with the standard yellow background color?

Murugan [Syncfusion]
Replied On November 7, 2006 09:52 PM UTC

Hi Bob,

HelperText backgroundcolor can be changed using treeViewAdv1.HelpTextControl.BackgroundColor property.

this.treeViewAdv1.HelpTextControl.BackgroundColor = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Info);

Please use the above code snippet and let me know if you need more assistance.

Murugan P.S

Administrator [Syncfusion]
Replied On November 7, 2006 11:51 PM UTC

Thanks - that worked fine.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon