dim int1 as integer
dim int2 as integer
int1=cint(text1.text)
int2=cint(text2.text)
debug.print int1+int2
dim int2 as integer
int1=cint(text1.text)
int2=cint(text2.text)
debug.print int1+int2
解决方案 »
- vb怎么切换到某个进程
- cn.Execute "insert into user(username,passwd) values ('" & Trim(Text1.Text) & " ','" & Trim(Text2.Text) & "')"
- vb中找不到crystal reports control 的控件
- 如何利用list控件的check属性?
- winsock编程之初级问题!
- 哪里能下到vb6.0的安装程序?谢谢~
- .NET马上就要发行了,VB.NET与C#我该选哪一个比较好?
- 如何用vb6判断你输入的是一个汉字?汉字编码是从多少到多少?
- 来北京一个星期了,还没找到工作,这下惨了
- 请斑竹或ACTIVEVB等超一流高手帮小弟看一下这个问题,万分感谢!!(关于勾子函数的问题))
- 如何用VB写一段代码获得Excel文件中已用部分的行数和列数?
- for each ... next 问题?!??
and click+***************
dim int1,int2
int1=cdbl(text1.text)
text1.text=""
*************useman insert number2 and click=
**********int2=cdbl(text1.text)
print int1+int2*************
a = CLng(InputBox("第一个数"))
b = CLng(InputBox("第二个数"))
MsgBox a + b, , "和"
End Sub
Two Text:Text1、Text2
One Command:Command1command1.caption="+" command2.caption="="****************when useman click text1insert number
and click+***************
dim int1,int2 as Double
int1=Val(text1.text)
text1.text=""
*************useman insert number2 and click=
**********int2=Val(text2.text)
Debug.print int1+int2*************
Dim num1, num2, sum As Single
Dim act As Integer
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0
If Text1.Text = "" Then
Text1.Text = "1"
Else
Text1.Text = Text1.Text + "1"
End If
Case 1
If Text1.Text = "" Then
Text1.Text = "2"
Else
Text1.Text = Text1.Text + "2"
End If
Case 2
If Text1.Text = "" Then
Text1.Text = "3"
Else
Text1.Text = Text1.Text + "3"
End If
Case 3
If Text1.Text = "" Then
Text1.Text = "4"
Else
Text1.Text = Text1.Text + "4"
End If
Case 4
If Text1.Text = "" Then
Text1.Text = "5"
Else
Text1.Text = Text1.Text + "5"
End If
Case 5
If Text1.Text = "" Then
Text1.Text = "6"
Else
Text1.Text = Text1.Text + "6"
End If
Case 6
If Text1.Text = "" Then
Text1.Text = "7"
Else
Text1.Text = Text1.Text + "7"
End If
Case 7
If Text1.Text = "" Then
Text1.Text = "8"
Else
Text1.Text = Text1.Text + "8"
End If
Case 8
If Text1.Text = "" Then
Text1.Text = "9"
Else
Text1.Text = Text1.Text + "9"
End If
Case 9
If Text1.Text = "" Then
Text1.Text = "0"
Else
Text1.Text = Text1.Text + "0"
End If
Case 10
If Text1.Text = "" Then
Text1.Text = "."
Else
Text1.Text = Text1.Text + "."
End If
Case 11
num1 = CDbl(Text1.Text)
Text1.Text = ""
act = 1
Case 12
num1 = CDbl(Text1.Text)
Text1.Text = ""
act = 2
Case 13
num1 = CDbl(Text1.Text)
Text1.Text = ""
act = 3
Case 14
num1 = CDbl(Text1.Text)
Text1.Text = ""
act = 4
Case 15
num1 = CDbl(Text1.Text)
Text1.Text = ""
act = 5
Case 16
Text1.Text = ""
num1 = 0: num2 = 0: sum = 0
Case 17
num2 = CDbl(Text1.Text)
If act = 1 Then
Text1.Text = num1 + num2
End If
If act = 2 Then
Text1.Text = num1 - num2
End If
If act = 3 Then
Text1.Text = num1 * num2
End If
If act = 4 Then
Text1.Text = num1 / num2
End If
If act = 5 Then
Text1.Text = num1 Mod num2
End If
If act = 6 Then
Text1.Text = num1 ^ num2
End If
'Select Case act
'Case 1
' sum = num1 + num2 '求和
' Text1.Text = sum
'case 2
' sum = num1 - num2 '
' Text1.Text = sum
'Case 3
' sum = num1 * num2
' Text1.Text = sum
'Case 4
' sum = num1 / num2
' Text1.Text = sum
'Case 5
' sum = num1 Mod num2
' Text1.Text = sum
'End Select
Case 18
Unload Me
Case 19
Text1.Text = "0" + CStr(1 / CDbl(Text1.Text))
Case 20
Text1.Text = (CDbl(Text1.Text)) ^ (1 / 2)
Case 21
num1 = CDbl(Text1.Text)
act = 6
Text1.Text = ""
End Select
End Sub