pexam11_15.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 86 行
FRM
86 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4185
ClientLeft = 60
ClientTop = 345
ClientWidth = 6855
LinkTopic = "Form1"
ScaleHeight = 4185
ScaleWidth = 6855
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox P1
Height = 3255
Left = 120
ScaleHeight = 3195
ScaleWidth = 6555
TabIndex = 4
Top = 120
Width = 6615
End
Begin VB.CommandButton Command4
Caption = "清除全部"
Height = 495
Left = 4560
TabIndex = 3
Top = 3480
Width = 975
End
Begin VB.CommandButton Command3
Caption = "清除圆"
Height = 495
Left = 3360
TabIndex = 2
Top = 3480
Width = 975
End
Begin VB.CommandButton Command2
Caption = "画圆"
Height = 495
Left = 2160
TabIndex = 1
Top = 3480
Width = 975
End
Begin VB.CommandButton Command1
Caption = "画背景"
Height = 495
Left = 960
TabIndex = 0
Top = 3480
Width = 975
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()
P1.AutoRedraw = True
dx = P1.ScaleWidth / 20
P1.ForeColor = vbYellow
For I = 1 To 19
P1.Line (I * dx, 0)-(I * dx, P1.ScaleHeight)
Next I
End Sub
Private Sub Command2_Click()
P1.AutoRedraw = False
P1.ForeColor = vbRed
Randomize
For I = 1 To 20
cx = Int(Rnd * P1.ScaleWidth)
cy = Int(Rnd * P1.ScaleHeight)
P1.Circle (cx, cy), 200
Next I
End Sub
Private Sub Command3_Click()
P1.AutoRedraw = False
P1.Cls
End Sub
Private Sub Command4_Click()
P1.AutoRedraw = True
P1.Cls
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?