📄 form1.frm
字号:
VERSION 5.00
Object = "{32A4927E-FB95-11D1-BF5B-00A024982E5B}#94.0#0"; "AXGRID.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5850
ClientLeft = 60
ClientTop = 345
ClientWidth = 7065
LinkTopic = "Form1"
ScaleHeight = 5850
ScaleWidth = 7065
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command5
Caption = "Change"
Height = 375
Left = 1020
TabIndex = 11
Top = 4380
Width = 855
End
Begin VB.CommandButton Command4
Caption = "Clear"
Height = 375
Left = 120
TabIndex = 10
Top = 5250
Width = 855
End
Begin VB.CommandButton Command3
Caption = "Size 12"
Height = 315
Index = 4
Left = 6150
TabIndex = 8
Top = 5235
Width = 840
End
Begin VB.CommandButton Command3
Caption = "StrikeThru"
Height = 315
Index = 3
Left = 5055
TabIndex = 7
Top = 5250
Width = 1035
End
Begin VB.CommandButton Command3
Caption = "Underline"
Height = 315
Index = 2
Left = 4140
TabIndex = 6
Top = 5250
Width = 840
End
Begin VB.CommandButton Command3
Caption = "Italic"
Height = 315
Index = 1
Left = 3240
TabIndex = 5
Top = 5250
Width = 840
End
Begin VB.CommandButton Command3
Caption = "Font, Color, Bold"
Height = 465
Index = 0
Left = 2145
TabIndex = 4
Top = 5250
Width = 1065
End
Begin VB.CommandButton Command2
Caption = "Add"
Height = 375
Left = 135
TabIndex = 3
Top = 4395
Width = 855
End
Begin VB.CommandButton Command1
Caption = "Delete"
Height = 375
Left = 135
TabIndex = 1
Top = 4815
Width = 855
End
Begin axGridControl.axgrid axgrid1
Height = 4005
Left = 270
TabIndex = 0
Top = 120
Width = 6270
_extentx = 11060
_extenty = 7064
showgrid = -1 'True
gridsolid = -1 'True
gridlinecolor = 12632256
redraw = -1 'True
borderstyle = 5
allowselection = 0 'False
backcolorfixed = 12632256
forecolorfixed = -2147483635
font = "Form1.frx":0000
fontfixed = "Form1.frx":002C
End
Begin VB.Label Label2
Caption = "Enter text in cell 2,2 and press this first \/"
Height = 810
Left = 2115
TabIndex = 9
Top = 4425
Width = 1065
End
Begin VB.Label Label1
Caption = "Try pressing the right mouse button too"
Height = 240
Left = 3315
TabIndex = 2
Top = 4335
Width = 3360
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub axgrid1_BtnClick(Col As Integer)
MsgBox Col
axgrid1.TextMatrix(axgrid1.Row, Col) = "update"
axgrid1.Refresh
End Sub
Private Sub axgrid1_MouseDown(button As Integer, Shift As Integer, x As Single, y As Single)
If button = 2 Then MsgBox "right mouse " + Str(axgrid1.Row) + "," + Str(axgrid1.Col)
End Sub
Private Sub Command1_Click()
axgrid1.RemoveItem axgrid1.Row
End Sub
Private Sub Command2_Click()
'axgrid1.Rows = axgrid1.Rows + 1
axgrid1.AddItem "test" + vbTab + "test1" + vbTab + "" + vbTab + "12"
End Sub
Private Sub Command3_Click(Index As Integer)
Select Case Index
Case 0
If axgrid1.CellFontName(2, 2) = "Arial" Then
axgrid1.CellBackColor(2, 2) = vbWhite
axgrid1.CellForeColor(2, 2) = vbBlack
axgrid1.CellFontName(2, 2) = ""
Else
axgrid1.CellBackColor(2, 2) = vbRed
axgrid1.CellForeColor(2, 2) = vbBlack
axgrid1.CellFontBold(2, 2) = True
axgrid1.CellFontName(2, 2) = "Arial"
End If
Case 1
axgrid1.CellFontItalic(2, 2) = True
Case 2
axgrid1.CellFontUnderline(2, 2) = True
Case 3
axgrid1.CellFontStrikeThru(2, 2) = True
Case 4
axgrid1.CellFontSize(2, 2) = 12
End Select
End Sub
Private Sub Command4_Click()
axgrid1.Clear
End Sub
Private Sub Command5_Click()
axgrid1.TextMatrix(1, 1) = "TEST"
Row = 1: Col = 4
axgrid1.TextMatrix(Row, Col) = "UPDATE"
axgrid1.Refresh
End Sub
Private Sub Form_Load()
axgrid1.AutoSetup 2, 7, False, True, "Col1 |List |No Edit |Upper |Numeric |Date |Checkmark"
axgrid1.AddLookup 2, "Text1", 1
axgrid1.AddLookup 2, "Text2", 2
axgrid1.AddLookup 2, "Text3", 3
axgrid1.AddLookup 2, "Text4", 4
axgrid1.AddButton 3
axgrid1.ColAllowEdit(3) = False
axgrid1.ColMask(4) = 1 'uppercase
axgrid1.ColMask(5) = 2 'numeric
axgrid1.ColAlign(5) = 2 'right aligned
axgrid1.ColMask(6) = 3 'date
axgrid1.ColMask(7) = 4 'checkmark
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -