CommandButton (btn)

CommandButton - This control allows the user to perform a specific action and will run a separate subroutine.

Default BackColor = System > Button Face
Default ForeColor = System > Button Text
Default Font - Tahoma, 8, regular
You should always have the Cancel button on the right hand side of your dialog boxes

Me.btnOK.Font.Bold = True 
Me.btnOK.Font.Size = 10
Me.btnOK.BackColor = RGB(41, 105, 207)
Me.btnOK.ForeColor = RGB(255, 255, 255)

Arrows

Use Wingding3
Left Arrow - (t) - Alt + 116
Right Arrow - (u) - Alt + 117
Up Arrow - (p) - Alt + 112
Down Arrow (q) - Alt + 113
font size - regular 10, can change colour to Desktop
size (20 by 20)


Same Subroutine

If you want to have multiple command buttons executing the same procedure, this can be done using a class module.
You should consider making the Cancel button the default for forms that support operations that can't be undone (such as delete).
You can always add one and not make it visible


Properties

Accelerator Lets you specify a character that will be underlined in the caption to provide a shortcut key
AutoSizeAllows the commandbutton to resize automatically to display its entire contents
BackColorThe background colour of the button
BackStyleThe background style of the button
CancelIf you want your dialog box to close when you press Esc then change the Cancel property to True for the command button that closes the form.
CaptionThe text that appears on the command button
DefaultYou should always set a command button to be pressed when the user presses Enter. Set it to True
Font 
ForeColorThe foreground colour of the button
LockedSpecifies whether a control can be edited. When a control is locked and enabled, it can still initiate events and can still receive the focus.
MouseIconThe full path of the custom icon
MousePointerSpecifies the type of pointer displayed when the user positions the mouse over the button
Name 
PictureThe full path of a bitmap file to display on the button
PicturePositionThe location of the picture relative to its caption
TakeFocusOnClickSpecifies whether the control takes focus when clicked.
WordWrapIf you want to write more than one line of text then just set the WordWrap property to True

Events

BeforeDragOver 
BeforeDropOrPaste 
Click 
DblClick 
Enter 
Error 
Exit 
KeyDown 
KeyPress 
KeyUp 
MouseDown 
MouseMove 
MouseUp 

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext