📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "文本框示例"
ClientHeight = 3675
ClientLeft = 60
ClientTop = 345
ClientWidth = 5310
LinkTopic = "Form1"
ScaleHeight = 3675
ScaleWidth = 5310
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 4080
TabIndex = 11
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "清除"
Height = 375
Left = 3000
TabIndex = 5
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "装载文本"
Height = 375
Left = 1920
TabIndex = 4
Top = 3240
Width = 1095
End
Begin VB.Frame Frame2
Caption = "操作说明"
Height = 1935
Left = 2760
TabIndex = 3
Top = 1200
Width = 2295
Begin VB.Label Label2
Height = 1575
Left = 120
TabIndex = 10
Top = 240
Width = 2055
End
End
Begin VB.Frame Frame1
Caption = "操作选项"
Height = 1935
Left = 240
TabIndex = 2
Top = 1200
Width = 2295
Begin VB.OptionButton Option4
Caption = "选中所有文本"
Height = 255
Left = 120
TabIndex = 9
Top = 1440
Width = 1695
End
Begin VB.OptionButton Option3
Caption = "光标在结尾"
Height = 255
Left = 120
TabIndex = 8
Top = 1080
Width = 1695
End
Begin VB.OptionButton Option2
Caption = "光标在第三个字符后"
Height = 255
Left = 120
TabIndex = 7
Top = 720
Width = 1935
End
Begin VB.OptionButton Option1
Caption = "光标在开头处"
Height = 255
Left = 120
TabIndex = 6
Top = 360
Width = 1935
End
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
MultiLine = -1 'True
TabIndex = 0
Top = 480
Width = 5055
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "文本框示例"
BeginProperty Font
Name = "黑体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 1
Top = 0
Width = 5055
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()
Text1.Text = "白日依山尽,黄河入海流。" & vbCrLf & "欲穷千里目,更上一层楼。"
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label2.Caption = ""
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Option1_Click()
Text1.SelStart = 0
Text1.SetFocus
Label2.Caption = "光标被移动到文本的开头处。"
End Sub
Private Sub Option2_Click()
Text1.SelStart = 3
Text1.SetFocus
Label2.Caption = "光标被移动到文本的第三个字符后面。"
End Sub
Private Sub Option3_Click()
Text1.SelStart = 26
Text1.SetFocus
Label2.Caption = "光标被移动到文本的结尾处。"
End Sub
Private Sub Option4_Click()
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 26
Label2.Caption = "选中了文本框中的所有字符"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -