VB单选怎么用来控制按钮 20
例如:一个小计算器我t1、t2与t3当单选1选中时点击计算按钮时t3=t1+t2、当单选2选中时点击计算按钮时是t3=t1-t2代码要怎么写...
例如:一个小计算器我t1、t2与t3 当单选1选中时点击计算按钮时t3=t1+t2、当单选2选中时点击计算按钮时是t3=t1-t2 代码要怎么写
展开
展开全部
Dim t1, t2, t3
Private Sub Form_Load()
t1 = 9
t2 = 5
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
t3 = t1 + t2
Me.Caption = t3
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
t3 = t1 - t2
Me.Caption = t3
End If
End Sub
Private Sub Form_Load()
t1 = 9
t2 = 5
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
t3 = t1 + t2
Me.Caption = t3
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
t3 = t1 - t2
Me.Caption = t3
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询