OptionGroup (statement)


OptionGroup .Identifier


Specifies the start of a group of option buttons within a dialog box template.


The .Identifier parameter specifies the name by which the group of option buttons can be referenced by statements in a dialog function (such as DlgFocus and DlgEnable). This parameter also creates an integer variable whose value corresponds to the index of the selected option button within the group (0 is the first option button, 1 is the second option button, and so on). This variable can be accessed using the following syntax: DialogVariable.Identifier.

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

When the dialog box is created, the option button specified by .Identifier will be on; all other option buttons in the group will be off. When the dialog box is dismissed, the .Identifier will contain the selected option button.


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); OptionButton (statement); Picture (statement); PushButton (statement); Text (statement); TextBox (statement); Begin Dialog (statement), PictureButton (statement).

More information