In the code below I
Call CopyToolStripMenuItem which effectively copies the properties of
saveToolStripMenuItem one at a time into newItem.
The next statement changes the Text of newItem to "New"
The next statement adds newItem to the DropDownItems.
Finally I assign an event to newItem.Click.
But what I really want to assign to newItem.Click is whatever is assigned to
saveToolStripMenuItem.Click
Do you know how to do that?
Thanks
ToolStripMenuItem newItem;
newItem = CloneToolStripMenuItem(saveToolStripMenuItem);
newItem.Text="New";
this.fileToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
newItem});
newItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
Archived from group: microsoft>public>dotnet>languages>csharp