满意答案
首先看看VB的语句和关键词,熟悉熟悉,看不懂没关系。然后再熟悉VB的编程环境和控件。再尝试编个简单的程序。比如求正方形面积。
这里给你一段代码,用TEXT输入再换成FRM格式打开。
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2100
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 2100
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
Height = 375
Left = 2160
TabIndex = 4
Top = 840
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 3600
TabIndex = 3
Top = 1440
Width = 975
End
Begin VB.CommandButton Command1
Caption = "计算"
Height = 495
Left = 2400
TabIndex = 2
Top = 1440
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Left = 2160
TabIndex = 0
Top = 240
Width = 1695
End
Begin VB.Label Label2
Caption = "正方形的面积:"
Height = 375
Left = 720
TabIndex = 5
Top = 960
Width = 1335
End
Begin VB.Label Label1
Caption = "正方形的边长:"
Height = 375
Left = 720
TabIndex = 1
Top = 360
Width = 1455
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Text2.Text = Val(Text1.Text) * Val(Text1.Text) 'Val是指把字符转化为数值,即进行运算的格式
End Sub
Private Sub Command2_Click()
End '退出
End Sub
看懂了之后再找几本书可能感触更大
00分享举报