Hello!
I have a System.Windows. Forms.MenuStrip with some ToolStripMenuIt em.
One of these ToolStripMenuIt em is called saveMemberToolS tripMenuItem.
This one is defined like this this.saveMember ToolStripMenuIt em = new
System.Windows. Forms.ToolStrip MenuItem();
I have also a ContextMenuStri p which is connected to the Form.
In the Form C-tor I have these statements
ToolStripMenuIt em[] formMenuItemLis t = new ToolStripMenuIt em[1];
formMenuItemLis t[0] = new ToolStripMenuIt em("Save Member", null,
new
System.EventHan dler(saveMember Click));
ContextMenuStri p formMenu = new ContextMenuStri p();
formMenu.Items. AddRange(formMe nuItemList);
ContextMenuStri p = formMenu;
ContextMenuStri p.Enabled = false;
Now to my question.
I have noticed that if I use the previous saveMemberToolS tripMenuItem object
instead of creating a new one
in formMenuItemLis t[0] will the saveMemberToolS tripMenuItem be vanished in
the MenuStrip. I just wonder
can somebody explain the reason for this in a understandable way.
//Tony
I have a System.Windows. Forms.MenuStrip with some ToolStripMenuIt em.
One of these ToolStripMenuIt em is called saveMemberToolS tripMenuItem.
This one is defined like this this.saveMember ToolStripMenuIt em = new
System.Windows. Forms.ToolStrip MenuItem();
I have also a ContextMenuStri p which is connected to the Form.
In the Form C-tor I have these statements
ToolStripMenuIt em[] formMenuItemLis t = new ToolStripMenuIt em[1];
formMenuItemLis t[0] = new ToolStripMenuIt em("Save Member", null,
new
System.EventHan dler(saveMember Click));
ContextMenuStri p formMenu = new ContextMenuStri p();
formMenu.Items. AddRange(formMe nuItemList);
ContextMenuStri p = formMenu;
ContextMenuStri p.Enabled = false;
Now to my question.
I have noticed that if I use the previous saveMemberToolS tripMenuItem object
instead of creating a new one
in formMenuItemLis t[0] will the saveMemberToolS tripMenuItem be vanished in
the MenuStrip. I just wonder
can somebody explain the reason for this in a understandable way.
//Tony
Comment