我刚学VB!教程里要我编一个加减运算的程序,我不懂,请哪位高手指点指点!谢谢!
解决方案 »
- 我现在在设计了一个数据库1里有一个表,另一个数据库2里面也有一表,这个表是升序的.我想在数据库2的表下面插入数据库1里的表
- TAPI的ACTIVEX软件
- 在下新手,请各位大侠介绍一本很容易上手的VB从书!!谢谢了!!
- 请教 如何用API解决 控件再添加数据的时候 闪烁 问题?
- 二个小问题,请教各位,谢谢!!
- 请问如何能够得到一个进程在内存中的首地址和在内存中占用的最大空间?
- 请各位帮忙,谢谢!!
- 不用odbc怎么连接远程oriacal数据库
- 关于利用combo控件选择查询条件的SQL语句的问题
- 服务器配置问题
- 求助:关于ARExportExcel类型,送分了!!
- 一张图片存在数据库中,怎么样取出来
dim i,j as integer
i=5
j=8
msgbox i+j
最简单的加法
我现在就是不知道对那两个按钮的Click事件过程怎么编写代码!
你的这些问题书中都有说明的
属性问题可以查msdn,比我们说的详细很多:)
两个变量,加,减
这是如此
试试看^_^
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
Height = 270
Left = 1920
TabIndex = 3
Top = 960
Width = 1335
End
Begin VB.TextBox Text1
Height = 270
Left = 1920
TabIndex = 2
Top = 360
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "-"
Height = 615
Left = 2520
TabIndex = 1
Top = 2280
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "+"
Height = 615
Left = 480
TabIndex = 0
Top = 2280
Width = 1695
End
Begin VB.Label Label3
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 255
Left = 1920
TabIndex = 6
Top = 1560
Width = 1335
End
Begin VB.Label Label2
Caption = "数字 2:"
Height = 255
Left = 840
TabIndex = 5
Top = 960
Width = 735
End
Begin VB.Label Label1
Caption = "数字 1:"
Height = 255
Left = 840
TabIndex = 4
Top = 360
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option ExplicitPrivate Sub Command1_Click()
Label3.Caption = "=" & (Val(Text1) + Val(Text2))
End SubPrivate Sub Command2_Click()
Label3.Caption = "=" & (Val(Text1) - Val(Text2))
End Sub
text3.text=val(text1.text)+val(text2.text) command1 是加法
text3.text=val(text1.text)-val(text2.text) command2 是减法
用+ - * / Mod ()反正就是和列数学表达式似的 把变量连接起来就OK了