📄 frmdraw.frm
字号:
VERSION 5.00
Begin VB.Form frmDraw
AutoRedraw = -1 'True
Caption = "Fig. 9.15: Drawing Properties"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 5955
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 5955
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdClear
Caption = "Clear"
Height = 495
Left = 1440
TabIndex = 9
Top = 1800
Width = 1215
End
Begin VB.CheckBox chkAutoRedraw
Caption = "AutoRedraw"
Height = 495
Left = 120
TabIndex = 8
Top = 2520
Width = 1215
End
Begin VB.CommandButton cmdDraw
Caption = "Draw"
Height = 495
Left = 120
TabIndex = 7
Top = 1800
Width = 1215
End
Begin VB.TextBox txtFillStyle
Height = 375
Left = 1440
TabIndex = 3
Text = "1"
Top = 1080
Width = 1215
End
Begin VB.TextBox txtDrawStyle
Height = 375
Left = 1440
TabIndex = 2
Text = "0"
Top = 600
Width = 1215
End
Begin VB.TextBox txtDrawMode
Height = 375
Left = 1440
TabIndex = 1
Text = "13"
Top = 120
Width = 1215
End
Begin VB.PictureBox picPicture
AutoRedraw = -1 'True
Height = 3135
Left = 2760
ScaleHeight = 3075
ScaleWidth = 3075
TabIndex = 0
Top = 0
Width = 3135
End
Begin VB.Label lblFillStyle
Caption = "FillStyle (0-7):"
Height = 375
Left = 0
TabIndex = 6
Top = 1080
Width = 1335
End
Begin VB.Label lblDrawStyle
Caption = "DrawStyle (0-6):"
Height = 375
Left = 0
TabIndex = 5
Top = 600
Width = 1335
End
Begin VB.Label lblDrawMode
Caption = "DrawMode (1-16):"
Height = 375
Left = 0
TabIndex = 4
Top = 120
Width = 1335
End
End
Attribute VB_Name = "frmDraw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 9.15
' DrawMode, DrawStyle, and FillStyle properties
Option Explicit
Private Sub Form_Load()
picPicture.ForeColor = vbRed ' Set drawing color
End Sub
Private Sub chkAutoRedraw_Click()
' Update picPicture's AutoRedraw
picPicture.AutoRedraw = chkAutoRedraw.Value
End Sub
Private Sub cmdClear_Click()
' Enable AutoRedraw so the PictureBox can
' be cleared with a call to Cls
picPicture.AutoRedraw = True
Call picPicture.Cls
' Uncheck CheckBox and set AutoRedraw to
' False.
chkAutoRedraw.Value = vbUnchecked
picPicture.AutoRedraw = False
End Sub
Private Sub cmdDraw_Click()
Dim v As Integer
Call Randomize
v = txtDrawMode.Text
If v >= vbBlackness And v <= vbWhiteness Then
picPicture.DrawMode = v
Else
picPicture.DrawMode = vbCopyPen
txtDrawMode.Text = vbCopyPen
End If
v = txtDrawStyle.Text
If v >= vbSolid And v <= vbInsideSolid Then
picPicture.DrawStyle = v
Else
picPicture.DrawStyle = vbSolid
txtDrawStyle.Text = vbSolid
End If
v = txtFillStyle.Text
If v >= vbFSSolid And v <= vbDiagonalCross Then
picPicture.FillStyle = v
Else ' Out of range reset to defaults
picPicture.FillStyle = vbFSTransparent
txtFillStyle.Text = vbFSTransparent
End If
' Draw the circle
picPicture.Circle (picPicture.Width / 2, _
picPicture.Height / 2), _
Int(2000 * Rnd())
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -