DesktopBevelButton

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from DesktopUIControl)

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

Events
Closing FocusLost MouseEnter
ConstructContextualMenu FocusReceived MouseExit
ContextualMenuItemSelected KeyDown MouseMove
DragEnter KeyUp MouseUp
DragExit MenuSelected MouseWheel
DragOver MouseDown Opening
DropObject MouseDrag Pressed
Properties
Active fa-lock-32.png Handle fa-lock-32.png MouseCursor
AllowAutoDeactivate HasBackgroundColor Name fa-lock-32.png
AllowFocus Height PanelIndex
AllowTabStop Icon Parent
BackgroundColor IconAlignment Scope fa-lock-32.png
BevelStyle IconDeltaX TabIndex
Bold IconDeltaY TextColor
ButtonStyle Index fa-lock-32.png Tooltip
Caption Italic Top
CaptionAlignment Left Transparent
CaptionDelta LockBottom Underline
CaptionPosition LockLeft Value
Enabled LockRight Visible
FontName LockTop Width
FontSize Menu Window fa-lock-32.png
FontUnit MenuStyle
Methods
AcceptFileDrop AddActionNotificationReceiver RemoveActionNotificationReceiver
AcceptPictureDrop Close SetFocus
AcceptRawDataDrop DrawInto
AcceptTextDrop Refresh
Enumerations
BevelStyles CaptionAlignments IconAlignments
ButtonStyles CaptionPositions MenuStyles

Notes

fa-info-circle-32.png
On macOS, DesktopBevelButton is not a native control and does not automatically change its appearance in dark mode.

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

The "No Bevel" option for the BevelStyle property is functional only on Microsoft Windows. On platforms with cursor, the button appears to have no border until the cursor enters the bounds of the BevelButton control. Then the outline of the button appears. On non-Windows systems, the "No Bevel" option has the same appearance of "Small Bevel."

Sample Code

The following code places an icon in the DesktopBevelButton, aligns it, and specifies the position of the caption. The graphic, "DatabaseQueryIcon," has been added to the project.

Me.Icon = DatabaseQueryIcon
Me.IconAlignment = DesktopBevelButton.IconAlignments.TopLeft
Me.CaptionAlignment = DesktopBevelButton.CaptionAlignments.Left
Me.CaptionPosition = DesktopBevelButton.CaptionPositions.RightOfIcon
Me.IconDeltaX = 2
Me.IconDeltaY = 1

The following code creates a bevel button menu.

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

me.Caption = "Month"
me.CaptionAlignment = DesktopBevelButton.CaptionAlignments.Left
me.MenuStyle = DesktopBevelButton.MenuStyles.Right

Var myMenu As New DesktopMenuItem
For Each m As String In months
myMenu.AddMenu(New DesktopMenuItem(m))
Next m

me.Menu = myMenu

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

Me.Caption = SelectedItem.Text

See Also

DesktopComboBox, DesktopPopupMenu, DesktopButton controls.