BevelButton.Menu
From Xojo Documentation
Property (As MenuItem )
aBevelButton.Menu = newMenuItemValue
or
MenuItemValue = aBevelButton.Menu
New in 2019r2
Supported for all project types and targets.
or
MenuItemValue = aBevelButton.Menu
New in 2019r2
Supported for all project types and targets.
The button's drop-down menu.
Sample Code
This code in the Open event handler of a BevelButton adds a menu to it. The first menu item is numbered zero.
Var months() As String = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
Me.Caption = "Month"
Me.CaptionAlignment = BevelButton.CaptionAlignments.Left
Me.MenuStyle = BevelButton.MenuStyles.Right
Var myMenu As New MenuItem
For Each m As String In months
myMenu.AddMenu(New MenuItem(m))
Next
Me.Menu = myMenu
Me.Caption = "Month"
Me.CaptionAlignment = BevelButton.CaptionAlignments.Left
Me.MenuStyle = BevelButton.MenuStyles.Right
Var myMenu As New MenuItem
For Each m As String In months
myMenu.AddMenu(New MenuItem(m))
Next
Me.Menu = myMenu
This code in the MenuSelected event handler displays the selected menu:
MessageBox(selectedItem.Value)