A button on a form.

Syntax

[<oRef> =] new PushButton(<container> [,<name expC>])

<oRef>

A variable or property—typically of <container>—in which to store a reference to the newly created PushButton object.

<container>

The container—typically a Form object—to which you’re binding the PushButton object.

<name expC>

An optional name for the PushButton object. If not specified, the PushButton class will auto-generate a name for the object.

Properties

The following tables list the properties and events of interest in the PushButton class. (No particular methods are associated with this class.)

Property

Default

Description

baseClassName

PUSHBUTTON

Identifies the object as an instance of the PushButton class

bitmapAlignment

0 (Default)

Controls position of bitmaps and text on the pushButton

className

(PUSHBUTTON)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

colorNormal

BtnText/BtnFace

The color of the button

default

false

Whether the button is the default button on the form

disabledBitmap

 

The bitmap to display on the button when it’s disabled

downBitmap

 

The bitmap to display on the button when it’s pressed down

focusBitmap

 

The bitmap to display on the button when it has focus

group

 

The group to which the button belongs

speedBar

false

Whether the button acts like a tool button, which never gets focus

systemTheme

true

Whether to use XP Visual Style button, or Windows Classic button

text

<same as name>

The text that appears on the PushButton face

textLeft

false

When a button has both a bitmap and text label, whether the text appears to the left or right of the bitmap

toggle

false

Whether the button acts like a toggle switch, staying down when pressed

upBitmap

0

The bitmap to display on the button when it’s not down and does not have focus

value

false

Whether the button is pressed (used when toggle is true)

 

Event

Parameters

Description

onClick

 

After the PushButton is clicked

 

The following table lists the common properties, events, and methods of the PushButton class:

Property

 

Event

 

Method

before
borderStyle

dragEffect

enabled

fontBold

fontItalic

fontName

fontSize

fontStrikeout

fontUnderline

form

height

helpFile

helpId

hWnd

id
left

mousePointer

name

pageno

parent

printable

speedTip

statusMessage

systemTheme

tabStop

top

visible

width

beforeRelease
onClose

onDesignOpen

onDragBegin

onGotFocus

onHelp

onLeftDblClick

onLeftMouseDown

onLeftMouseUp

onLostFocus

onMiddleDblClick

onMiddleMouseDown
onMiddleMouseUp

onMouseMove

onOpen

onRightDblClick

onRightMouseDown

onRightMouseUp

when

drag( )
move( )

release( )

setFocus( )

Description

Use a PushButton object to execute an action when the user clicks it.