一个普通计算器的小程序
我做的有好多功能实现不了,哪位大侠发上来一个,我想对比着参考一下,谢谢了
这个我正好写了不过 也许很菜大家帮我修改吧呵呵
Dim a As Single
Private Sub Command1_Click() Text1.Text = Text1.Text & 1
End Sub
Private Sub Command10_Click() Text1.Text = Text1.Text & 0 End Sub
Private Sub Command11_Click() Text2.Text = Text1.Text Text1.Text = "" a = 1 End Sub
Private Sub Command12_Click() Text2.Text = Text1.Text Text1.Text = "" a = 2 End Sub
Private Sub Command13_Click() Text2.Text = Text1.Text Text1.Text = "" a = 3 End Sub
Private Sub Command14_Click() Text1.Text = Text1.Text & 0 & 0 End Sub
Private Sub Command15_Click() Select Case a Case 1 Text3.Text = Val(Text2.Text) + Val(Text1.Text) Text1.Text = Text3.Text Text2.Text = "" Text3.Text = "" Case 2 Text3.Text = Val(Text2.Text) - Val(Text1.Text) Text1.Text = Text3.Text Text2.Text = "" Text3.Text = "" Case 3 Text3.Text = Val(Text2.Text) * Val(Text1.Text) Text1.Text = Text3.Text Text2.Text = "" Text3.Text = "" Case 4 Text3.Text = Val(Text2.Text) / Val(Text1.Text) Text1.Text = Text3.Text Text2.Text = "" Text3.Text = ""
End Select End Sub
Private Sub Command16_Click() Text2.Text = Text1.Text Text1.Text = "" a = 4 End Sub
Private Sub Command17_Click() Text1 = "" End Sub
Private Sub Command2_Click() Text1.Text = Text1.Text & 2 End Sub
Private Sub Command3_Click() Text1.Text = Text1.Text & 3 End Sub
Private Sub Command4_Click() Text1.Text = Text1.Text & 4 End Sub
Private Sub Command5_Click() Text1.Text = Text1.Text & 5 End Sub
Private Sub Command6_Click() Text1.Text = Text1.Text & 6 End Sub
Private Sub Command7_Click() Text1.Text = Text1.Text & 7 End Sub
Private Sub Command8_Click() Text1.Text = Text1.Text & 8 End Sub
Private Sub Command9_Click() Text1.Text = Text1.Text & 9 End Sub