📄 form1.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form1
Caption = "动态增减MSFlexGrid行数"
ClientHeight = 3840
ClientLeft = 60
ClientTop = 345
ClientWidth = 4020
Icon = "Form1.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3840
ScaleWidth = 4020
StartUpPosition = 1 '所有者中心
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 465
Left = 120
ScaleHeight = 465
ScaleWidth = 555
TabIndex = 5
Top = 3285
Width = 555
End
Begin VB.CommandButton Command3
Caption = "删除一行"
Height = 405
Left = 1695
TabIndex = 4
Top = 3315
Width = 1050
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 405
Left = 2730
TabIndex = 2
Top = 3315
Width = 1050
End
Begin VB.CommandButton Command1
Caption = "增加一行"
Height = 405
Left = 645
TabIndex = 1
Top = 3315
Width = 1050
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 2865
Left = 135
TabIndex = 0
Top = 375
Width = 3660
_ExtentX = 6456
_ExtentY = 5054
_Version = 393216
End
Begin VB.Label Label1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808000&
Height = 345
Left = 180
TabIndex = 3
Top = 75
Width = 2625
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_Activate()
MSFlexGrid1.Rows = 3 '设置MSFlexGrid1行数
For i = 0 To 2
MSFlexGrid1.TextMatrix(i, 0) = i
Next i
MSFlexGrid1.ColWidth(0) = 1700 '设置MSFlexGrid1列宽
MSFlexGrid1.ColWidth(1) = 1700
Label1.Caption = "当前共" & Str(MSFlexGrid1.Rows) & " 行" '显示MSFlexGrid1行数
End Sub
Private Sub Command1_Click() '增加MSFlexGrid1行数
MSFlexGrid1.AddItem (MSFlexGrid1.Rows)
Label1.Caption = "当前共" & Str(MSFlexGrid1.Rows) & " 行"
End Sub
Private Sub Command3_Click() '减少MSFlexGrid1行数
MSFlexGrid1.RemoveItem (MSFlexGrid1.Rows - 1)
Label1.Caption = "当前共" & Str(MSFlexGrid1.Rows) & " 行"
End Sub
Private Sub Command2_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -