Description

The AButton control is a push button that performs a task when the user either clicks the button or presses a key.

Properties

 

Alignment

Description

Name

TabStop

BackColor

Enabled

Object

Tag

BevelWidth

Font

Picture

ToolTipText

BorderStyle

Font3D

PictureAlignment

Top

Cancel

ForeColor

PictureDrawMode

Visible

Caption

Height

PictureHeight

WhatsThisHelpID

CaptionHeight

HelpContextID

PictureLeft

WhatsThisHelpText

CaptionLeft

hWnd

PictureTop

Width

CaptionTop

Image

PictureWidth

 

CaptionWidth

Left

Shape

 

Methods

 

Move

SetFocus

ShowWhatsThis

Refresh

ShowHelpContext

ZOrder

Events

 

OnClick

OnKeyDown

OnLostFocus

OnMouseUp

OnGotFocus

OnKeyPress

OnMouseDown

OnWhatsThisHelp

OnHelpContext

OnKeyUp

OnMouseMove

 

Constants

 

enumAButtonAlignment

enumAButtonPictureDrawMode

enumAButtonPictureAlignment

enumAButtonShape

Comments

The button can have a rectangle, rounded rectangle, ellipse shape as set by the Shape property. The Button is can be drawn with or without border (ambient property). The border is drawn around the Shape.

The bevel area. Inside the border a raised bevel is drawn. The bevel width is specified by the BevelWidth property. The bevel area can be displayed in two positions, Down and Up, corresponding to when a button is pressed or released .

Inside the bevel area is the focus area. This area is used to draw the focus line when the button has the focus.

Inside the focus area is the button inner area. This area is drawn with the button background color and can contain a caption and/or a picture.

The caption is drawn at the position specified by the Alignment property in one of nine places in the inner area. The text font can be set with the Font property and the color of the text with the ForeColor property. The Font3D property can produce a 3D effect on the font. When the button is disabled the text is grayed.

The button can also have a picture. By default, when the Picture property is set the picture is drawn left of the text in a clipped drawing mode. The picture width is calculated by subtracting the text width (and 10% space between the text and picture) from the inner width. The following affect the picture size and position:

See also

ARadioButton, ASwitch