📄 form1.frm
字号:
VERSION 5.00
Object = "{A8B3B723-0B5A-101B-B22E-00AA0037B2FC}#1.0#0"; "GRID32.OCX"
Begin VB.Form Form1
Caption = "表格数据输入"
ClientHeight = 3945
ClientLeft = 60
ClientTop = 345
ClientWidth = 6450
LinkTopic = "Form1"
ScaleHeight = 3945
ScaleWidth = 6450
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 1
Top = 3240
Width = 1455
End
Begin MSGrid.Grid Grid1
Height = 2895
Left = 240
TabIndex = 0
Top = 120
Width = 5895
_Version = 65536
_ExtentX = 10398
_ExtentY = 5106
_StockProps = 77
BackColor = 16777215
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Rows = 10
Cols = 10
End
Begin VB.Label Label1
Caption = "请输入"
Height = 180
Left = 960
TabIndex = 2
Top = 3240
Width = 540
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const EnterAsc = 13
Const TabAsc = 9
Private Sub Grid1_KeyPress(KeyAscii As Integer)
Text1.SetFocus
Text1.SelStart = 0
If KeyAscii <> EnterAsc And KeyAscii <> TabAsc Then
SendKeys Chr(KeyAscii)
End If
End Sub
Private Sub Grid1_RowColChange()
Text1.Text = Grid1.Text
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = EnterAsc Then
Grid1.SetFocus
KeyAscii = 0
End If
End Sub
Private Sub Text1_LostFocus()
Grid1.Text = Text1.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -