![]() ![]() If someone would like to fill in the rest of this code and post it here. In both if-else structures the other types of posible elements should still be added (combobox,button.) and the other parameters of the items should also be set. You call this by using the ' CopyMenuStrip'-method. Private Sub AddCopyOfMenuStripItemCollection( ByRef toolStripMenuItem As, ByVal menus As ) Msi_new = New (msi.Text, Nothing, AddressOf MenuItem_Click, msi.Name)ĪddCopyOfMenuStripItemCollection(msi_new, msi_temp.DropDownItems)ĮlseIf TypeOf (msi) Is Then Private Function CopyMenuStrip( ByRef menustrip As ) As ĭim msi_temp As ĭim msi_new As The following tasks are illustrated in this walkthrough: Creating a Windows Forms project. The form also responds when a user selects a menu item. This walkthrough demonstrates how to use a MenuStrip control to create a standard menu. My rule is: "never add any event handlers in the designer".I've written some code to "clone" a menuStrip.Īll it does is make a new MenuStrip with all the same elements in it (with an other handler) You can provide a standard menu for your forms with the MenuStrip control. Note that some members criticized my approach, so decide by yourself.
0 Comments
Leave a Reply. |