Home > Language Reference > Classes > Form

Group Property

Element selected from a control group.

Syntax

Public Property Get Group(ByVal iGroup As Integer) As Control

ParameterDescription
iGroupControl group number.

Remarks

The Group property returns a reference to the control selected from within a control group identified by the iGroup parameter. If this argument is null, or does not correspond to an existing control group, the value Nothing is returned.

You can group CheckBox or PushButton controls by attributing a non null value to their Group property during design time. Refer to the description of this property for more information.

The following example shows how to use this property to determine which of the three PushButton controls in the same group is selected:

Private Sub Button2_Click()
  Dim c as Control
 
  Set c = Group(PushButton1.Group)
  If c Is PushButton1 Then
    MsgBox "1"
  ElseIf c Is PushButton2 Then
    MsgBox "2"
  Else
    MsgBox "3"
  End If
End Sub

The Autograph sample makes use of grouped PushButton controls.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A