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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TreeView and popup menu

Thread ID:





1811 Nov 27,2002 04:07 PM UTC Nov 27,2002 05:13 PM UTC WinForms 1
Tags: Tools
Charles Carlin
Asked On November 27, 2002 04:07 PM UTC

If I have a popup menu associated with multiple treeview controls, how do I determine which control was the one that the menu selection occurred on. And is it also possible to determine the actual node, or do I need to select the node first and just use the selectednode property?

Administrator [Syncfusion]
Replied On November 27, 2002 05:13 PM UTC

Chuck, You ca use the PopupMenu.SourceControl to determine on which TreeView the context menu was shown. And yes, please select the node on mouse down, as follows: private void treeView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if(e.Button == MouseButtons.Right) { treeView1.SelectedNode = treeView1.GetNodeAt (e.X ,e.Y ); } } and then use the SelectedNode property. Regards, Praveen Ramesh


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

Live Chat Icon For mobile
Live Chat Icon