📄 form1.frm
字号:
VERSION 5.00
Object = "{A8B3B723-0B5A-101B-B22E-00AA0037B2FC}#1.0#0"; "GRID32.OCX"
Begin VB.Form Form1
Caption = "网格控件"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 5250
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 5250
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
AutoSize = -1 'True
Height = 570
Left = 240
Picture = "Form1.frx":0000
ScaleHeight = 510
ScaleWidth = 540
TabIndex = 7
Top = 1800
Width = 600
End
Begin VB.TextBox Text2
Height = 375
Left = 3960
TabIndex = 6
Text = "3"
Top = 720
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Left = 3960
TabIndex = 3
Text = "2"
Top = 120
Width = 975
End
Begin VB.CommandButton Command2
Caption = "删除图片"
Height = 495
Left = 2400
TabIndex = 2
Top = 2520
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "增加图片"
Height = 495
Left = 1200
TabIndex = 1
Top = 2520
Width = 1215
End
Begin MSGrid.Grid Grid1
Height = 1335
Left = 0
TabIndex = 0
Top = 0
Width = 3135
_Version = 65536
_ExtentX = 5530
_ExtentY = 2355
_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
Cols = 3
End
Begin VB.Label Label2
Caption = "Cols:"
Height = 180
Left = 3360
TabIndex = 5
Top = 720
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Rows:"
Height = 180
Left = 3360
TabIndex = 4
Top = 120
Width = 540
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()
Grid1.AddItem "1st cell" & Chr(9) & "2nd cell" & Chr(9) & "3rd cell"
End Sub
Private Sub Command1_Click()
Grid1.Row = 0
Grid1.Col = 0
Grid1.ColWidth(0) = Picture1.Width
Grid1.RowHeight(0) = Picture1.Height
Grid1.Picture = Picture1.Picture
End Sub
Private Sub Command2_Click()
Grid1.Row = 0
Grid1.Col = 0
Grid1.Picture = LoadPicture()
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Grid1.Rows = CInt(Text1.Text)
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Grid1.Cols = CInt(Text2.Text)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -