📄 line.frm
字号:
VERSION 5.00
Begin VB.Form frmLine
Caption = "Fig. 9.18: Using the Line control"
ClientHeight = 4335
ClientLeft = 2400
ClientTop = 2145
ClientWidth = 4530
LinkTopic = "Form1"
ScaleHeight = 4335
ScaleWidth = 4530
Begin VB.TextBox txtStyle
Height = 375
Left = 2520
TabIndex = 4
Text = "1"
Top = 2760
Width = 1215
End
Begin VB.CommandButton cmdButton
Caption = "Change"
Height = 495
Left = 1680
TabIndex = 2
Top = 3600
Width = 1215
End
Begin VB.TextBox txtWidth
Height = 375
Left = 2520
TabIndex = 1
Text = "1"
Top = 2280
Width = 1215
End
Begin VB.Label lblPrompt2
Caption = "Enter style (0-6):"
Height = 375
Left = 840
TabIndex = 3
Top = 2760
Width = 1575
End
Begin VB.Label lblPrompt
Caption = "Enter width (1-100):"
Height = 375
Left = 840
TabIndex = 0
Top = 2280
Width = 1575
End
Begin VB.Line linLine
X1 = 240
X2 = 4200
Y1 = 240
Y2 = 1560
End
End
Attribute VB_Name = "frmLine"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 9.18
' Using the Line control
Option Explicit
Private Sub cmdButton_Click()
Dim v As Integer
v = txtStyle.Text
If v >= 0 And v <= 6 Then
linLine.BorderStyle = v
Else
linLine.BorderStyle = 1
txtStyle.Text = 1
End If
v = txtWidth.Text
If v >= 1 And v <= 100 Then
' If v is greater than 1 some BorderStyle
' properties are ignored
linLine.BorderWidth = v
Else
linLine.BorderWidth = 1
txtWidth.Text = 1
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -