Eyal Lewin

Eyal Lewin

  • NA
  • 18
  • 0

Do not close ContextMenuStrip

Dec 9 2009 8:17 AM
Hello,
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

Answers (1)