Option Explicit
Dim Test As Boolean
'bouton qui réinitialise tous les contrôles
Private Sub CommandButton1_Click()
Dim ctrl As Control
For Each ctrl In Me.Controls
ctrl.Enabled = True
If TypeOf ctrl Is MSForms.OptionButton Then
ctrl.Value = False
End If
Next
Frame1.Enabled = True
For Each ctrl In Frame1.Controls
ctrl.Enabled = True
Next
Frame2.Enabled = True
For Each ctrl In Frame2.Controls
ctrl.Enabled = True
Next
End Sub
'procédure qui, au clic, rends les contrôles de la frame2 Enable
Private Sub OptionButton10_Click()
Dim ctrl As Control
If Test = True Then Exit Sub
Frame2.Enabled = False
For Each ctrl In Frame2.Controls
ctrl.Enabled = False
Next
End Sub
'procédure qui, au clic, rends les contrôles de la frame1 Enable
Private Sub OptionButton4_Click()
Dim ctrl As Control
If Test = True Then Exit Sub
Frame1.Enabled = False
For Each ctrl In Frame1.Controls
ctrl.Enabled = False
Next
End Sub
'procédure qui mets la variable Test à true
'en vue d'empêcher le clic sur les optionbutton 10 et 4
Private Sub OptionButton5_Click()
If OptionButton5 = True Then
Test = True
Else
Test = False
End If
End Sub
'procédure qui mets la variable Test à false
pour permettre le clic sur les optionbutton 10 et 4
Private Sub OptionButton6_Click()
If OptionButton6 = True Then
Test = False
Else
Test = True
End If
End Sub