public sub MenuItem_click(byval Id as integer) handles mybase.menuclick
'...
end sub
'...
private sub any_sub()
Menu1.MenuItems.Add("hy", mybase.menuclick(id))
end sub
Private Sub MenuItem66_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem66.Click
Dim newmainframe As New MainFrame(NbMainFrame + 1, NbMainFrame + 1, Me)
NbMainFrame += 1
MainframeTemp(NbMainFrame) = newmainframe
MainframeOpen(NbMainFrame) = True
newmainframe.Show()
Dim sendertemp As Object
sendertemp = NbMainFrame
????? AddHandler MyMenu.Click, AddressOf HandlerSub ????
Menu1.MenuItems.Add("Hy",???? What do I have to write Here???? (id))
Menu1.MenuItems.Item(NbMainFrame + 3).Visible = True
End Sub
Private Sub MenuItem_Click(ByVal id As Integer) ??? What do I have to write Here????
MainframeTemp(id).Activate()
End Sub
Private Sub MenuItem66_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem66.Click
Dim newmainframe As New MainFrame(NbMainFrame + 1, NbMainFrame + 1, Me)
NbMainFrame += 1
MainframeTemp(NbMainFrame) = newmainframe
MainframeOpen(NbMainFrame) = True
newmainframe.Show()
Dim sendertemp As Object
sendertemp = NbMainFrame
AddHandler MyMenu.Click, AddressOf MenuItem_Click
Menu1.MenuItems.Add("Hy",MenuItem_Click)
Menu1.MenuItems.Item(NbMainFrame + 3).Visible = True
End Sub
Private Sub MenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
MainframeTemp(id).Activate()
End Sub
Dim arrlist As New ArrayList()
arrlist.Add(someobject)
If sender Is somemenuitem Then
MsgBox("some menu item was clicked")
End If