VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5655
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   5655
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdClear 
      Caption         =   "Clear"
      Height          =   495
      Left            =   4080
      TabIndex        =   0
      Top             =   240
      Width           =   1215
   End
   Begin VB.Frame Frame2 
      Caption         =   "Frame2"
      Height          =   2475
      Left            =   2280
      TabIndex        =   2
      Top             =   180
      Width           =   1695
      Begin VB.OptionButton opt2 
         Caption         =   "opt2"
         Height          =   375
         Index           =   3
         Left            =   120
         TabIndex        =   10
         Top             =   1500
         Width           =   1335
      End
      Begin VB.OptionButton opt2 
         Caption         =   "opt2"
         Height          =   375
         Index           =   2
         Left            =   120
         TabIndex        =   9
         Top             =   1080
         Width           =   1335
      End
      Begin VB.OptionButton opt2 
         Caption         =   "opt2"
         Height          =   375
         Index           =   1
         Left            =   120
         TabIndex        =   8
         Top             =   660
         Width           =   1335
      End
      Begin VB.OptionButton opt2 
         Caption         =   "opt2"
         Height          =   375
         Index           =   0
         Left            =   120
         TabIndex        =   7
         Top             =   240
         Width           =   1335
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Frame1"
      Height          =   2475
      Left            =   240
      TabIndex        =   1
      Top             =   180
      Width           =   1575
      Begin VB.OptionButton opt1 
         Caption         =   "Option1"
         Height          =   315
         Index           =   3
         Left            =   120
         TabIndex        =   6
         Top             =   1500
         Width           =   1095
      End
      Begin VB.OptionButton opt1 
         Caption         =   "Option1"
         Height          =   315
         Index           =   2
         Left            =   120
         TabIndex        =   5
         Top             =   1080
         Width           =   1095
      End
      Begin VB.OptionButton opt1 
         Caption         =   "Option1"
         Height          =   315
         Index           =   1
         Left            =   120
         TabIndex        =   4
         Top             =   660
         Width           =   1095
      End
      Begin VB.OptionButton opt1 
         Caption         =   "Option1"
         Height          =   315
         Index           =   0
         Left            =   120
         TabIndex        =   3
         Top             =   300
         Width           =   1095
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdClear_Click()
Dim i As Integer

    For i = 0 To 3
       opt1(i).Enabled = True
       opt1(i).Value = False
       opt2(i).Enabled = True
       opt2(i).Value = False
    Next i
End Sub

Private Sub Form_Load()
Dim i As Integer

    'add some labels to the buttons
    For i = 0 To 3
        opt1(i).Caption = "Team" & i
        opt2(i).Caption = "Team" & i
    Next i
End Sub

Private Sub DisableSelection()
Dim ctlActive As Object
Dim ctlDisable As Object
Dim i As Integer

    'Find which option group was select
    Set ctlActive = Me.ActiveControl
    
    'Set the control arrays to the proper group
    If ctlActive.Name = "opt1" Then
        Set ctlActive = opt1
        Set ctlDisable = opt2
    Else
        Set ctlActive = opt2
        Set ctlDisable = opt1
    End If
    
    
    For i = 0 To 3
        'make sure a previously disable contorl is enabled again
        ctlActive(i).Enabled = True
        ctlDisable(i).Enabled = True

        'Find the control you just clicked
        'and disable the same control in
        'the other group
        If ctlActive(i).Value Then
            ctlDisable(i).Enabled = False
        End If
        
        'If a second control has been selected then
        'make sure the same control is diabled in
        'both groups
        If ctlDisable(i).Value Then
            ctlActive(i).Enabled = False
        End If
    Next i
    
End Sub

Private Sub opt1_Click(Index As Integer)
    DisableSelection
End Sub

Private Sub opt2_Click(Index As Integer)
    DisableSelection
End Sub
