|
星飛雄馬 さん、こんにちは
もう少しスマートなやり方もあるかと思いますが、
これでどうですか?
***********************************************************
Sub Test(i As Long)
Dim a As Long
Dim h As Long
For h = 0 To Me.Controls.Count - 1
If TypeName(Me.Controls(h)) = "ToggleButton" Then
a = a + 1
End If
Next h
If Me.Controls("ToggleButton" & i).Value = True Then
For h = 1 To a
If i <> h Then
Me.Controls("ToggleButton" & h).Value = False
End If
Next h
Else
Me.Controls("ToggleButton" & i).Value = False
End If
End Sub
'==============================================
Private Sub ToggleButton1_Click()
Call Test(1)
End Sub
***********************************************************
一応出来てるみただけど・・・・
|
|