vb用if语句单选按钮做加减乘除

2023-02-14 09:43:44趣智分享 【作者:admin1】 【 字体:

vb用if语句单选按钮做加减乘除

 

Private Sub Option1_Click(Index As Integer)

If Index = 0 Then Text3 = Val(Text1) + Val(Text2)

If Index = 1 Then Text3 = Val(Text1) - Val(Text2)

If Index = 2 Then Text3 = Val(Text1) * Val(Text2)

If Index = 3 Then

If Val(Text2) <> 0 Then Text3 = Val(Text1) / Val(Text2)

End If

 

End Sub

vb中的if语句的用法VB中if语句与select之间的区别是什么?

阅读全文
返回顶部
栏目链接