5.13.frm
来自「VB6.0应用例题」· FRM 代码 · 共 67 行
FRM
67 行
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "打字练习"
ClientHeight = 3390
ClientLeft = 45
ClientTop = 330
ClientWidth = 4995
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3390
ScaleWidth = 4995
StartUpPosition = 3 '窗口缺省
Begin VB.ListBox List1
Height = 1680
Left = 480
TabIndex = 2
Top = 1320
Width = 4095
End
Begin VB.TextBox Text1
Height = 390
Left = 480
TabIndex = 0
Top = 600
Width = 4080
End
Begin VB.Label Label1
Caption = "输入(回车换行):"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 1
Top = 240
Width = 1935
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Form1.KeyPreview = True '使窗体在其它控件之前响应键盘事件
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyC And Shift = 2 Then '按Ctrl+C键
Unload Me
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then 'ASCII码为13表示回车
List1.AddItem Text1.Text
Text1.Text = ""
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?