vb实用小程序(vb的小程序)
关于vb实用小程序,vb的小程序这个很多人还不知道,今天天天来为大家解答以上的问题,现在让我们一起来看看吧!
1、Dim v As Boolean '是否次按下运算符Dim s As String '存放上一次按的运算符Dim x As Double '存放个作数Dim y As Double '存放第二个作数Private Sub Command1_Click(Index As Integer)If Form1.Tag = "T" Then If Index = 10 Then Text1.Text = "0" Else Text1.Text = Command1(Index).Caption End If Form1.Tag = ""Else a = Text1.Text Text1.Text = a & Command1(Index).CaptionEnd IfEnd SubPrivate Sub Command2_Click(Index As Integer)Form1.Tag = "T"If v Then x = Val(Text1.Text) v = Not vElse y = Val(Text1.Text) Select Case s Case 0 Text1.Text = x + y Case 1 Text1.Text = x - y Case 2 Text1.Text = x y Case 3 If y <> 0 Then Text1.Text = x / y Else MsgBox "除数不能为0!", 32, "error" End If End Select x = Text1.TextEnd If s = IndexEnd SubPrivate Sub Command3_Click()Form1.Tag = "T"y = Text1.TextSelect Case s Case 0 Text1.Text = x + y Case 1 Text1.Text = x - y Case 2 Text1.Text = x y Case 3 If y <> 0 Then Text1.Text = x / y Else MsgBox "除数不能为0!", 32, "error" End If End Select x = Text1.Text y = 0 v = False s = 5End Sub。
本文到这结束,希望上面文章对大家有所帮助。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系 836084111@qq.com 删除。