Hi,
I am creating a submenu at the runtime and this submenu can have many items (the number is not known at compile time). I want to how to create event handler for these menuitems. Is there a generalized way to handle the events on these submenu items? Please look at the following code and suggest:
Code:public void GetAllHierarchyList(MenuItem mnuFile) { mnuFile.MenuItems.Clear(); foreach (HierarchyNode h in this.hierarchy.HierarchieNodes) { mnuFile.MenuItems.Add (h.Type); //want event handler for all these //items } }




Reply With Quote