CheckBox (chb)

CheckBox - This control allows the user to either select or deselect an option.


To return a checkbox or option box selection in lower case use Format(chkSelectedOnly.Value,"<").
When the checkbox is checked it has a value of True and when it is not checked it has a value of False.
Very useful when you want to give the user a choice of yes or no. On or off.


chbCheckbox1.Value = True 
chbCheckbox1.Value = False

Properties

AcceleratorSets or retrieves the accelerator key.
AlignmentSpecifies the position of the checkbox relative to its caption. (either frmAlignmentRight or frmAlignmentLeft)
AutoSizeSpecifies whether an object automatically resizes to display its entire contents. (true or false)
BackColorSpecifies the background color.
BackStyleSets or retrieves the background style. (either fmBackStyleTransparent or fmBackStyleOpaque)
CaptionThe text that appears next to the checkbox.
ControlTipText 
EnabledSpecifies whether the control can receive the focus and respond to user-generated events. (true or false)
FontSpecifies the font used to display the caption text. Tahoma, regular, 8 (default)
ForeColorSpecifies the foreground color.
GroupNameCreates a group of mutually exclusive OptionButton controls.
Height18 is the default but 15 is sufficient.
LockedSpecifies whether the control can be edited.
MouseIconAssign a custom icon that appears when the user moves the mouse over this control. The MousePointer property must be set to fmMousePointerCustom.
MousePointerSpecifies the type of pointer displayed when the user positions the mouse over a particular object. fmMousePointerDefault is the default.
PictureSpecifies a picture that is displayed instead of the text caption.
PicturePositionSpecifies the location of the picture relative to the text caption. fmPicturePositionAboveCenter is the default
SpecialEffectSpecifies the visual appearance of an object. (either fmButtonEffectSunken or fmButtonEffectFlat)
TabIndexThe index number in the tab order
TabStopIndicates whether the control can receive focus when the user tabs to it. (true or false). The default is True
TextAlignSpecifies how the text is aligned. (fmTextAlignLeft, fmTextAlignCenter or fmTextAlignRight)
TripleStateDetermines whether the control can accept the Null state. The default is false
ValueSpecifies the status or content of the control
Width 
WordWrapIndicates whether the text caption will automatically wrap at the end of the line.

Methods

Move 
SetFocus 
ZOrder 

Events

AfterUpdate 
BeforeUpdate 
BeforeDragOverOccurs when a drag-and-drop operation is in progress.
BeforeDropOrPasteOccurs when the user is about to drop or paste data onto an object.
ChangeOccurs when the Value property changes.
ClickOccurs when the user clicks on the control
DblClickOccurs when the user points to an object and then clicks a mouse button twice.
Enter 
Exit 
ErrorOccurs when a control detects an error and cannot return the error information to a calling program.
KeyDownOccurs in sequence when a user presses a key.
KeyPressOccurs when the user presses an ANSI key.
KeyUpOccurs in sequence when a user releases a key.
MouseDownOccur when the user presses the mouse button.
MouseMoveOccurs when the user moves the mouse.
MouseUpOccur when the user releases the mouse button.

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