Its hard to come up with a subject title for this...
But basicly this is what happens
i have a normal context menu attacked to a treeview with a bunch of treeviewnodes in it. so when u right click a node the context menu comes up,
however when you right click it dosnt always work, actully it never works at first you have to right click 3 - 5 times before the menu will display...
Any thoughts?
Thanks!
Loading
Hirendra SisodiyaPosted Apr 21, 2010, 1:40 AM
Hello
' Can i know that how to set contextmenustrip on treeviewnodes....
if you want to add contextmenustrip on only nodes of treeview
you can use this code:
For Each trv As TreeNode In TreeView1.Nodes
trv.ContextMenuStrip = ContextMenuStrip1
Next
Or
if you want to add only on child nodes,you can use this code:
For Each trv As TreeNode In TreeView1.Nodes
For Each Childtrv As TreeNode In trv.Nodes
Childtrv.ContextMenuStrip = ContextMenuStrip1
Next
Next
thanks
Please mark as answere if it helps