vb中的checkbox使用问题

2025-03-05 12:14:21
推荐回答(3个)
回答1:

Private Sub Check1_Click()
If Check1.Value = 0 Then
Command1.Visible = True
Command2.Visible = False
ElseIf Check1.Value = 1 Then
Command1.Visible = False
Command2.Visible = True
End If
End Sub

回答2:

Private Sub CheckBox1_Change()
If CheckBox1.Value = 0 Then
Command1.Visible = True
Command2.Visible = False
ElseIf CheckBox1.Value = -1 Then
Command1.Visible = False
Command2.Visible = True
End If
End Sub

回答3:

Private Sub Check1_Click()
Command1.Visible = Check1.Value
Command2.Visible = Check1.Value - 1
End Sub