From Xojo Documentation

For web apps, see WebButton.

Class (inherits from RectControl)

Used for creating a bevel button. A BevelButton can use text, a graphic, a pop-up menu, or several of these interface elements in combination.

Action DropObject MouseExit
Close GotFocus MouseMove
ConstructContextualMenu KeyDown MouseUp
ContextualMenuAction KeyUp MouseWheel
DragEnter LostFocus Open
DragExit MouseDown
DragOver MouseEnter
AcceptFocus Icon Parent
Active fa-lock-32.png IconAlign Scope fa-lock-32.png
AutoDeactivate IconDx TabIndex
BackColor IconDy TabStop
Bevel Index fa-lock-32.png TextColor
Bold Italic TextFont
ButtonType Left TextSize
Caption LockBottom TextUnit
CaptionAlign LockLeft Top
CaptionDelta LockRight Transparent
CaptionPlacement LockTop TrueWindow fa-lock-32.png
Enabled MenuValue Underline
Handle fa-lock-32.png MouseCursor Value
HasBackColor MouseX fa-lock-32.png Visible
HasMenu MouseY fa-lock-32.png Width
Height Name Window fa-lock-32.png
HelpTag PanelIndex
AcceptFileDrop AddSeparator List
AcceptPictureDrop Close Refresh
AcceptRawDataDrop DeleteAllRows RefreshRect
AcceptTextDrop DrawInto RemoveActionNotificationReceiver
AddActionNotificationReceiver InsertRow RemoveRow
AddRow Invalidate SetFocus


BevelButton is not a native Cocoa control and does not automatically change its appearance in dark mode.

A BevelButton can display a graphic, a label (caption), or both.

The first row in a menu has an index of zero.

If the Caption property contains an ampersand character, it will display only if it is preceded by another ampersand character. For example, if you set the Caption property to "Bob & Ray", only "Bob Ray" will display. You need to set it to "Bob && Ray". The ampersand character is used on Windows for keyboard accelerators. This is done to make applications on all platforms behave consistently.

The "No Bevel" option for the Bevel property is functional only for Windows XP and later. The button appears to have no border until the mouse enters the region of BevelButton control. Then the outline of the button appears. On other operating systems, the "No Bevel" option has the same appearance of "Small Bevel."

Sample Code

The following code places an icon in the bevel button, aligns it, and specifies the placement of the caption. The graphic, "DatabaseQuery," has been added to the project.

Me.Icon = DatabaseQuery
Me.IconAlign = 6
Me.CaptionAlign = 0
Me.CaptionPlacement = 2
Me.IconDx = 2
Me.IconDy = 1

The following code creates a bevel button menu.

Me.Caption = "Month"
Me.CaptionAlign = 0 // flush left
Me.HasMenu = 2 // menu on right

Dim months() As String = Array("January", "February", "March", "April", "May", "June", _
"July", "August", "September", "October", "November", "December")

For Each m As String In months

The following line of code in the BevelButton's Action event handler sets the BevelButton caption to the value that the user selects:

Me.Caption = Me.List(Me.MenuValue)

See Also

ComboBox, PopupMenu, PushButton controls.