i have a treeView component where a ContextMenuStrip is already assigned to it (ex. contextP)
now, i want to drag a node from one place to another in the treeView.
when i do so, i call the DragDrop event which has all my function's according to my needs.
in this event, i would like to call a different ContextMenuStrip named contextD.
i thought of using
.
.
.
contextD.Show(Point pt);
.
.
.
private void contextD_Opening(object sender, CancelEventArgs e)
{
ToolStripMenuItem itemMove = (ToolStripMenuItem)contextDrag.Items["ctextMoveItem"];
ToolStripMenuItem itemCopy = (ToolStripMenuItem)contextDrag.Items["ctextCopyItem"];
ToolStripMenuItem itemCancel = (ToolStripMenuItem)contextDrag.Items["ctextCancelItem"];
}
but when the opening event has finished, the main code continues, and the contextD is still shown, regardless to my selection.
how can i make the contextD to stay on, depending on my selection in the menu to continue my flow (do event's etc.) ?
then of course, how to close it when im finished with it ?
thanks
Eyal
Kirtan PatelPosted Dec 10, 2009, 10:21 PM
private void contextMenuStrip1_Closing(object sender, ToolStripDropDownClosingEventArgs e)
{
e.Cancel = true;
}
if my answer helps you then check "do you like this answer" check box please :)