MenuItem newMenuItem1 = new MenuItem(); MenuItem newMenuItem2 = new MenuItem(); MenuItem newExistMenuItem = (MenuItem)this.mnuTest.Items[0]; newMenuItem1.Header = "AAA"; newMenuItem1.Name = "mnuAAA"; newExistMenuItem.Items.Add(newMenuItem1); MenuItem newExistMenuItem2 = (MenuItem)this.mnuTest2.Items[1]; newMenuItem2.Header = "BBBBBB"; newMenuItem2.Name = "mnuBBBBB"; newExistMenuItem2.Items.Add(newMenuItem2); MenuItem mnuMenu = (MenuItem)this.FindName("mnuAAA"); MessageBox.Show(mnuMenu.Name.ToString());
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)