'[
' {Text: "_File", Children:
' [
' "_New", "_Save",
' {Text: "_Export", Children: ["Zip File", "Tar File"]},
' "-",
' "_Close"
' ]
' },
' {Text: "_Edit", Children:["Cu_t", "_Copy", "_Paste"] },
' {Text: "_Help", Children:
' [
' {Text: "Checked Item", Selected: True, Shortcut: {Key: "F1"}},
' {Text: "Disabled Item", Enabled: False},
' {Text: "Item With Unique Event Name",
' EventName: "mnu1234"},
' {Text: "Item With Tag", Tag: "MyTag"}
' ]
' }
']
Private Sub MenuBar1_Action
Dim mitem As MenuItem = Sender
Select mitem.Text
Case "_New"
xui.MsgboxAsync(mitem.text & " selected.","menubar")
End Select
End Sub
Private Sub MenuBar1_SelectedChange (Selected As Boolean)
Dim mitem As MenuItem = Sender
Dim mhelp As Menu = MenuBar1.Menus.Get(2)
Dim midisabled As MenuItem = mhelp.MenuItems.Get(1) ' Disabled Item
If Selected Then
Log(mitem.Text & " is selected")
midisabled.Enabled = True
Else
Log(mitem.Text & " is not selected")
midisabled.Enabled = False
' mhelp.MenuItems.Clear
Dim m1 As MenuItem
m1.Initialize("added Item", "m1")
mhelp.MenuItems.Add(m1)
End If
End Sub