OptionButton (statement)


OptionButton X,Y,width,height,title$ [,.Identifier]


Defines an option button within a dialog box template.


This statement can only appear within a dialog box template (that is, between the Begin Dialog and End Dialog statements).

The OptionButton statement accepts the following parameters:





X, Y

Integer coordinates specifying the position of the control (in dialog units) relative to the upper left corner of the dialog box.


width, height

Integer coordinates specifying the dimensions of the control in dialog units.



String containing text that appears within the option button. This text may contain an ampersand character to denote an accelerator letter, such as "&Portrait" for Portrait, which can be selected by pressing the P accelerator.



Name by which this control can be referenced by statements in a dialog function (such as DlgFocus and DlgEnable).


This example creates a group of option buttons.

Sub Main()
  Begin Dialog PowerTemplate 16,31,128,65,"Print"
    GroupBox 8,8,64,52,"Amplifier Output",.Junk
    OptionGroup .Orientation
      OptionButton 16,20,51,8,"10 Watts",.Ten
      OptionButton 16,32,51,8,"50 Watts",.Fifty
      OptionButton 16,44,51,8,"100 Watts",.Hundred
    OKButton 80,8,40,14
  End Dialog
  Dim PowerDialog As PowerTemplate
  Dialog PowerDialog
End Sub

See Also

CancelButton (statement); CheckBox (statement); ComboBox (statement); Dialog (function); Dialog (statement); DropListBox (statement); GroupBox (statement); ListBox (statement); OKButton (statement); OptionGroup (statement); Picture (statement); PushButton (statement); Text (statement); TextBox (statement); Begin Dialog (statement), PictureButton (statement).


Accelerators are underlined, and the accelerator combination Alt+letter is used.

More information