📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4710
ClientLeft = 60
ClientTop = 345
ClientWidth = 8160
LinkTopic = "Form1"
ScaleHeight = 4710
ScaleWidth = 8160
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdClear
Caption = "清空"
Height = 495
Left = 5880
TabIndex = 18
Top = 3240
Width = 1215
End
Begin VB.OptionButton cmdPic
Caption = "扇形"
Height = 495
Index = 7
Left = 120
Style = 1 'Graphical
TabIndex = 17
Top = 3960
Width = 1215
End
Begin VB.OptionButton cmdPic
Caption = "圆弧"
Height = 495
Index = 6
Left = 120
Style = 1 'Graphical
TabIndex = 16
Top = 3360
Width = 1215
End
Begin VB.OptionButton cmdPic
Caption = "椭圆"
Height = 495
Index = 5
Left = 120
Style = 1 'Graphical
TabIndex = 15
Top = 2760
Width = 1215
End
Begin VB.OptionButton cmdPic
Caption = "圆"
Height = 495
Index = 4
Left = 120
Style = 1 'Graphical
TabIndex = 14
Top = 2160
Width = 1215
End
Begin VB.OptionButton cmdPic
Caption = "矩形"
Height = 495
Index = 3
Left = 120
Style = 1 'Graphical
TabIndex = 13
Top = 1560
Width = 1215
End
Begin VB.OptionButton cmdPic
Caption = "直线"
Height = 495
Index = 2
Left = 120
Style = 1 'Graphical
TabIndex = 12
Top = 960
Width = 1215
End
Begin VB.OptionButton cmdPic
Caption = "点"
Height = 495
Index = 1
Left = 120
Style = 1 'Graphical
TabIndex = 11
Top = 360
Width = 1215
End
Begin VB.TextBox txtPic
Height = 495
Index = 1
Left = 6840
TabIndex = 10
Top = 840
Width = 1215
End
Begin VB.TextBox txtPic
Height = 495
Index = 0
Left = 6840
TabIndex = 9
Top = 240
Width = 1215
End
Begin VB.Frame Frame1
Caption = "图形绘制"
Height = 4455
Left = 0
TabIndex = 8
Top = 120
Width = 1575
End
Begin VB.CommandButton cmdQuit
Caption = "退出"
Height = 495
Left = 5880
TabIndex = 7
Top = 4080
Width = 1215
End
Begin VB.PictureBox Picture1
Height = 4455
Left = 1680
ScaleHeight = 4395
ScaleWidth = 3915
TabIndex = 6
Top = 120
Width = 3975
End
Begin VB.TextBox txtPic
Height = 495
Index = 3
Left = 6840
TabIndex = 1
Top = 2040
Width = 1215
End
Begin VB.TextBox txtPic
Height = 495
Index = 2
Left = 6840
TabIndex = 0
Top = 1440
Width = 1215
End
Begin VB.Label Label4
Caption = "填充颜色"
Height = 255
Left = 5880
TabIndex = 5
Top = 2040
Width = 855
End
Begin VB.Label Label3
Caption = "填充样式"
Height = 375
Left = 5880
TabIndex = 4
Top = 1440
Width = 735
End
Begin VB.Label Label2
Caption = "线宽"
Height = 375
Left = 5880
TabIndex = 3
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "颜色"
Height = 255
Left = 5880
TabIndex = 2
Top = 240
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClear_Click()
Picture1.Cls '清空画面
End Sub
Private Sub cmdPic_Click(Index As Integer)
Select Case Index
Case 1
Picture1.PSet (800, 800) '画点
Case 2
Picture1.Line (100, 1500)-(3600, 20) '画直线
Case 3
Picture1.Line (100, 2400)-(500, 3200), , B '画矩形
Case 4
Picture1.Circle (1800, 1800), 1000 '画圆
Case 5
Picture1.Circle (1000, 500), 800, , , , 0.4 '画椭圆
Case 6
Picture1.Circle (1000, 3000), 800, vbRed, 1, 5, 1.6 '画弧
Case 7
Picture1.Circle (3000, 3000), 800, vbRed, -1, -5 '画扇形
End Select
End Sub
Private Sub cmdQuit_Click()
End '结束程序
End Sub
Private Sub txtPic_Change(Index As Integer)
Select Case Index
Case 0
If Val(txtPic(Index)) <= 15 And Val(txtPic(Index)) >= 0 Then
Picture1.ForeColor = QBColor(Val(txtPic(Index))) '设置线条颜色
End If
Case 1
Picture1.DrawWidth = Val(txtPic(Index)) '设置线条宽度
Case 2
Picture1.FillStyle = Val(txtPic(Index)) '设置填充样式
Case 3
If Val(txtPic(Index)) <= 15 And Val(txtPic(Index)) >= 0 Then
Picture1.FillColor = QBColor(Val(txtPic(Index))) '设置填充颜色
End If
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -