473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How asign deferent contex menu to deferent treenode

I have app like Computer Managment app. on windows. I have everithing in
tree. I whant deferent context menu appear on deferent treenode items. How
can I do this?
Nov 16 '05 #1
1 1310
One way is to manually show the context menu, based on the node on which
user right-clicked.

Eg:
private void treeView_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
if (treeView.SelectedNode.Text == <node text>)
contextMenu1.Show (treeView, new Point (e.X, e.Y));
else if (treeView.SelectedNode.Text == <node text>)
contextMenu2.Show (treeView, new Point (e.X, e.Y));
else if (treeView.SelectedNode.Text == <node text>)
contextMenu3.Show (treeView, new Point (e.X, e.Y));
}
}

"Sergey Romanov" <serg4172(NoSpam)@mail.ru> wrote in message
news:A4**********************************@microsof t.com...
I have app like Computer Managment app. on windows. I have everithing in
tree. I whant deferent context menu appear on deferent treenode items. How
can I do this?
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Angelos | last post by:
Hello there, I am trying to write a script that will create dynamically a menu from MySQL database. The database table is a product categories table and it has the folowing filed: category_id,...
4
by: Phill | last post by:
Here's what I'm doing to make the right context mnue show up based on what node was cliked: private void tvwMenu_MouseUp(object sender, MouseEventArgs e) { //Select Node When Right Clicked &...
5
by: Dean L. Howen | last post by:
Dear friends, Could we determine when context menu should appear?
1
by: naijacoder naijacoder | last post by:
Hi Guys, I have an application below that is treeview menu populated from the database which works with asp.net webmatrix.But when i put it into code behind in Visual Studio.Net it gives the...
0
by: Rob | last post by:
I want to feed the menu control from a database which is set up as WebPageID, WebPageParent, URL where the WebPage Id is the primary key and the WebpageParent is the foreign key. The menu will...
1
by: alex | last post by:
Hi, how can i call a contex menu on a list box when the item is right clicked with the mouse ? there is a list box click event but how can i determine what mouse button was clicked ? Thanks...
2
by: Bry | last post by:
I have a context menu which is shared between a TreeView and ListView control (both controls show the same information, similar to how Windows Explorer works, so it makes sense to use the same menu...
0
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
1
by: AAaron123 | last post by:
If you see this posted twice - sorry. My news reader showed my first post as "No Longer Available" I have the following in a .css file. The treeNodes behave as if they were "a" elements. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.