我爱Aspx >> VB.Net >> 用vb编一个计算器,需要用到数组,看看下面的代码,欢迎来找碴!用vb编一个计算器,需要用到数组,看看下面的代码,欢迎来找碴!
代码,请帮我看看哪有问题:(我是要用数组作个计算器)
Option Explicit
Dim shu1 As Double, shu2 As Double @#先后输入的两个数
Dim result As Double @#做了运算的结果
Dim process, process0, process1, process2, process3, process4 As Variant @#保存数1与各个运算符的过程
Dim judge As Variant @#判断按了那个运算符
Private Sub Command1_Click(Index As Integer) @#0-9数字键
Text1.Text = Text1.Text & Index
Text1.SetFocus
End Sub
Private Sub Command1_KeyPress(Index As Integer, KeyAscii As Integer) @#阻止键盘输入,不过不知为什么没有用
KeyAscii = 0
End Sub
Private Sub Command2_Click(Index As Integer) @# "."键
Text1.Text = Text1.Text & "."
End Sub
Private Sub Command3_Click() @#退格键
If Text1.Text = "" Then
Exit Sub
End If
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
【我对这篇文章有话说?】
使用VB.NET实现 Google Web Serv..[05-20]
通过WMI获得硬盘和CPU的物理序列..[05-20]
Visual Basic.NET(将文本文件导入..[05-20]
让你的VB程序支持多国语言的切换[05-20]
VB.NET启动外部程序[05-20]
用VB6.0自制压缩与解压缩程序(一..[05-20]
用VB6.0自制压缩与解压缩程序(二..[05-20]
用VB6.0自制压缩与解压缩程序(三..[05-20]
如何用VB.NET编写XML文档[05-20]
持续集成 .Net手册[05-20]