📄 例3_3_3.frm
字号:
VERSION 5.00
Begin VB.Form FRM3_3_2
BackColor = &H00FFFFFF&
Caption = "命令按钮:设计实例"
ClientHeight = 4755
ClientLeft = 690
ClientTop = 1875
ClientWidth = 8580
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 4755
ScaleWidth = 8580
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 50
Left = 3960
Top = 3960
End
Begin VB.CommandButton Command4
BackColor = &H0000FF00&
Caption = "Stop Move"
Height = 495
Left = 5880
Style = 1 'Graphical
TabIndex = 4
Top = 3960
Width = 2535
End
Begin VB.CommandButton Command3
BackColor = &H00FF00FF&
Caption = "Continue Move"
Height = 495
Left = 240
Style = 1 'Graphical
TabIndex = 3
Top = 3960
Width = 2655
End
Begin VB.CommandButton Command2
BackColor = &H0080FFFF&
Caption = "Move Toward Left"
Height = 855
Left = 5880
Style = 1 'Graphical
TabIndex = 2
Top = 2760
Width = 2535
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 495
Left = 3960
ScaleHeight = 465
ScaleWidth = 585
TabIndex = 1
Top = 1920
Width = 615
End
Begin VB.CommandButton Command1
BackColor = &H000000FF&
Caption = "Move Toward Right"
Height = 855
Left = 240
Style = 1 'Graphical
TabIndex = 0
Top = 2760
Width = 2655
End
Begin VB.Label Label2
BackColor = &H00FFFF00&
Caption = "请根据汽车动作编写代码!"
Height = 495
Left = 2160
TabIndex = 6
Top = 1080
Width = 4335
End
Begin VB.Label Label1
BackColor = &H000000FF&
Caption = "命令按钮最重要的事件是单击(Click)事件,但单击后的执行的操作取决于事件过程中的代码."
ForeColor = &H0000FF00&
Height = 735
Left = 240
TabIndex = 5
Top = 120
Width = 8055
End
End
Attribute VB_Name = "FRM3_3_2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Picture1.Left = Picture1.Left + 200
End Sub
Private Sub Command2_Click()
Picture1.Left = Picture1.Left - 200
End Sub
Private Sub Command3_Click()
Timer1.Enabled = True
End Sub
Private Sub Command4_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Picture1.Picture = LoadPicture(App.Path + "\bw\cars.ico")
End Sub
Private Sub Timer1_Timer()
If Picture1.Left >= FRM3_3_2.Left + FRM3_3_2.Width Then Picture1.Left = Me.Left
Picture1.Move Picture1.Left + 50
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -