A single RadioButton on a form. The user may choose one from a set.

Syntax

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

<oRef>

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

<container>

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

<name expC>

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

Properties

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

Property

Default

Description

baseClassName

RADIOBUTTON

Identifies the object as an instance of the RadioButton class

className

(RADIOBUTTON)

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 RadioButton’s text label

dataLink

 

The Field object that is linked to the RadioButton

group

 

The group to which the RadioButton belongs

text

<same as name>

The text label that appears beside the RadioButton

textLeft

false

Whether the RadioButton’s text label appears to the left or to the right of the RadioButton

transparent

false

Whether the RadioButton object has the same background color or image as its container

value

 

Whether the RadioButton is visually marked as selected

 

Event

Parameters

Description

onChange

 

After the RadioButton gets selected or loses its selection

 

The following table lists the common properties, events, and methods of the RadioButton 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

onDesignOpen
onDragBegin

onGotFocus

onHelp

onLeftDblClick

onLeftMouseDown

onLeftMouseUp

onLostFocus

onMiddleDblClick

onMiddleMouseDown
onMiddleMouseUp

onMouseMove

onOpen

onRightDblClick

onRightMouseDown

onRightMouseUp

when

drag( )
move( )

release( )

setFocus( )

Description

Use a group of RadioButton objects to present the user a set of multiple choices, from which they can choose only one.

Each set of choices on a form must have the same group property. If there is only one group of RadioButtons on a form, the group can be left blank. You may use any string or number as the group property.

You may also use true and false in the group property to create RadioButton groups. Use true for the first button in each RadioButton group, and false for the rest. For example, if you create seven RadioButtons and set the group property of the first and fourth RadioButton to true, the first three buttons form one group, and the last four form another. The two groups are independent; the user can select one button in the first group and one button in the other.