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.
Unfortunately, activation email could not send to your email. Please try again.

Mnemonics and the Tree control

Thread ID:

Created:

Updated:

Platform:

Replies:

51185 Oct 30,2006 07:28 PM Nov 7,2006 06:51 PM Windows Forms 9
loading
Tags: Tools
Bob Walker
Asked On October 30, 2006 07:28 PM

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 12:55 AM

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.

TreeView_tooltip.zip


Regards,
Malarvizhi.

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

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.

Thanks,
Murugan P.S

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

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 05:22 PM

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.

Thanks,
Murugan P.S

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

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 3, 2006 07:53 PM

Hi,

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

Sample

Let me know if this works.

Regards,
S.Gopal.

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

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 04:52 PM

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.

Thanks,
Murugan P.S

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

Thanks - that worked fine.

CONFIRMATION

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.

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.

;