GroupBox (statement)


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


Defines a group box 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 group box control is used for static display only¾the user cannot interact with a group box control.

Separator lines can be created using group box controls. This is accomplished by creating a group box that is wider than the width of the dialog box and extends below the bottom of the dialog box; three sides of the group box are not visible.


If title$ is a zero-length string, then the group box is drawn as a solid rectangle with no title.

The GroupBox statement requires 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 the label of the group box. If title$ is a zero-length string, then no title will appear.




Optional parameter that specifies the name by which this control can be referenced by statements in a dialog function (such as DlgFocus and DlgEnable). If omitted, then the first two words of title$ are used.


This example shows the GroupBox statement being used both for grouping and as a separator line.

Sub Main()
  Begin Dialog OptionsTemplate 16,32,128,84,"Options"
    GroupBox 4,4,116,40,"Window Options"
    CheckBox 12,16,60,8,"Show &Toolbar",.ShowToolbar
    CheckBox 12,28,68,8,"Show &Status Bar",.ShowStatusBar
    GroupBox -12,52,152,48," ",.SeparatorLine
    OKButton 16,64,40,14,.OK
    CancelButton 68,64,40,14,.Cancel
  End Dialog
  Dim OptionsDialog As OptionsTemplate
  Dialog OptionsDialog
End Sub

See Also

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

More information