From Xojo Documentation
Jump to: navigation, search
For web applications, 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 ReadOnlyProperty.png IconAlign Scope ReadOnlyProperty.png
AutoDeactivate IconDx TabIndex
BackColor IconDy TabStop
Bevel Index ReadOnlyProperty.png TextColor
Bold Italic TextFont
ButtonType Left TextSize
Caption LockBottom TextUnit
CaptionAlign LockLeft Top
CaptionDelta LockRight TrueWindow ReadOnlyProperty.png
CaptionPlacement LockTop Underline
Enabled MenuValue Value
Handle ReadOnlyProperty.png MouseCursor Visible
HasBackColor MouseX ReadOnlyProperty.png Width
HasMenu MouseY ReadOnlyProperty.png Window ReadOnlyProperty.png
Height Name
HelpTag PanelIndex

AcceptFileDrop AddSeparator List
AcceptPictureDrop Close Refresh
AcceptRawDataDrop DeleteAllRows RefreshRect
AcceptTextDrop DrawInto RemoveActionNotificationReceiver
AddActionNotificationReceiver InsertRow RemoveRow
AddRow Invalidate SetFocus


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."


The following example 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 example 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.

Personal tools

Starting Out
Dig Deeper
More Help