| ■No98301 (ゆい さん) に返信
> ラジオボタン(RadioButton1、RadioButton1)と同様なことが、
> ボタン(Button3)でも出来るのでしょうか?
>
> 即ち、RadioButton1、RadioButton1、Button3のどれかが押されてもです。
処理としては同じです。
Dim ActiveButton As Button
Private Sub RadioButton1_Click(sender As Object, e As EventArgs) Handles RadioButton2.Click, RadioButton1.Click, Button3.Click
If Not (ActiveButton Is Nothing) Then
ActiveButton.Focus()
ActiveButton = Nothing
End If
End Sub
Private Sub Button1_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Button1.Validating, Button2.Validating
If TypeOf ActiveControl Is RadioButton Or ActiveControl Is Button3 Then
ActiveButton = sender
End If
End Sub |