practice9_6.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 70 行
FRM
70 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer1
Interval = 1000
Left = 4200
Top = 0
End
Begin VB.CommandButton Command1
Caption = "停止"
Height = 495
Left = 3720
TabIndex = 0
Top = 2640
Width = 855
End
Begin VB.Shape Shape1
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 735
Left = 1440
Shape = 3 'Circle
Top = 720
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim f As Integer
Private Sub Command1_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
f = 0
End Sub
Private Sub Timer1_Timer()
If f = 0 Then
If Shape1.Top + Shape1.Height > Form1.ScaleHeight Then
f = 1
Shape1.Top = Shape1.Top - 100
Else
Shape1.Top = Shape1.Top + 100
End If
Else
If Shape1.Top < 0 Then
f = 0
Shape1.Top = Shape1.Top + 100
Else
Shape1.Top = Shape1.Top - 100
End If
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?