📄 form1.frm
字号:
VERSION 5.00
Object = "{1118EDCB-88E1-457D-8DD2-F4F48858E69B}#8.12#0"; "LGXGRIDx.ocx"
Begin VB.Form Form1
Caption = "LgxGrid示例"
ClientHeight = 6015
ClientLeft = 165
ClientTop = 855
ClientWidth = 10035
LinkTopic = "Form1"
ScaleHeight = 6015
ScaleWidth = 10035
StartUpPosition = 3 '窗口缺省
Begin LgxgridV10.lgxgrid lgxgrid2
Height = 1455
Left = 3600
TabIndex = 1
Top = 1800
Visible = 0 'False
Width = 2655
_ExtentX = 4683
_ExtentY = 2566
slwok = 0 'False
BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Hfont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 8.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin LgxgridV10.lgxgrid lgxgrid1
Height = 5835
Left = 0
TabIndex = 0
Top = 120
Width = 9975
_ExtentX = 17595
_ExtentY = 10292
slwok = 0 'False
RowHeight = 330
BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Hfont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Menu F
Caption = "数据"
Begin VB.Menu tgetweb
Caption = "向Web发送和获得数据"
End
Begin VB.Menu gxml
Caption = "表格内数据转为XML"
End
Begin VB.Menu xmltoGrid
Caption = "把Xml存入表格"
End
Begin VB.Menu Dx
Caption = "编码和解码"
End
Begin VB.Menu Mt
Caption = "邮件"
End
Begin VB.Menu f0
Caption = "排序"
End
Begin VB.Menu f4
Caption = "按第一列排序"
End
Begin VB.Menu f16
Caption = "获得数据"
End
Begin VB.Menu f17
Caption = "设置数据"
End
Begin VB.Menu ToSelect
Caption = "直接用查询加载数据"
End
Begin VB.Menu f6
Caption = "查找"
End
Begin VB.Menu fa1
Caption = "清除所有数据"
End
Begin VB.Menu cFunc
Caption = "复制公式"
End
Begin VB.Menu pfunc
Caption = "粘贴公式"
End
Begin VB.Menu FuncGet
Caption = "获取公式"
End
Begin VB.Menu FuncSet
Caption = "设置公式"
End
Begin VB.Menu Toe
Caption = "ToExcel"
End
End
Begin VB.Menu czkz
Caption = "操作控制"
Begin VB.Menu f5
Caption = "跳到最后一个单元格"
End
Begin VB.Menu f2
Caption = "插入一行"
End
Begin VB.Menu f1
Caption = "删除选定行"
End
Begin VB.Menu f14
Caption = "设置区域"
End
Begin VB.Menu f20
Caption = "设置固定行"
End
Begin VB.Menu f21
Caption = "清除所有数据和格式"
End
Begin VB.Menu f22
Caption = "判断是否处于编辑状态"
End
Begin VB.Menu f23
Caption = "退出编辑"
End
Begin VB.Menu f24
Caption = "添加一列"
End
Begin VB.Menu f25
Caption = "删除最后一列"
End
Begin VB.Menu f26
Caption = "设置行数"
End
Begin VB.Menu f27
Caption = "设置列数"
End
Begin VB.Menu setFunc
Caption = "设置公式"
End
Begin VB.Menu f28
Caption = "生成固定行列"
End
Begin VB.Menu To50000
Caption = "添加50000行"
End
Begin VB.Menu To5
Caption = "缩为5行"
End
End
Begin VB.Menu d0
Caption = "设置格式"
Begin VB.Menu f7
Caption = "合并单元格"
End
Begin VB.Menu fa
Caption = "拆分单元格"
End
Begin VB.Menu f91
Caption = "设置列宽"
End
Begin VB.Menu f9
Caption = "获得列宽"
End
Begin VB.Menu f10
Caption = "在某列处画一条竖线"
End
Begin VB.Menu f11
Caption = "清除一条竖线"
End
Begin VB.Menu f13
Caption = "获得表头标题"
End
Begin VB.Menu f12
Caption = "设置表头标题"
End
Begin VB.Menu f15
Caption = "设置选定单元格为只读"
End
Begin VB.Menu f18
Caption = "改变高度与宽度"
End
Begin VB.Menu f19
Caption = "设置字体"
End
Begin VB.Menu f3
Caption = "隔行设置颜色"
End
Begin VB.Menu d1
Caption = "设置对齐"
End
Begin VB.Menu d2
Caption = "上下对齐"
End
Begin VB.Menu d3
Caption = "设置背景色"
End
Begin VB.Menu d4
Caption = "设置前景色"
End
End
Begin VB.Menu dy
Caption = "打印"
Begin VB.Menu f92
Caption = "预览"
End
Begin VB.Menu f8
Caption = "打印设置"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Mysjk As ADODB.Connection '定义数据库对象变量
Dim showok As Boolean '不许值改变事件被执行
Dim Chno As Boolean '不许值改变事件被执行
Dim oldRow As Long
Dim oldList As Long
Private Sub CFunc_Click()
lgxgrid1.copyFunc
End Sub
Private Sub d1_Click()
lgxgrid1.SetLAlignment lgxgrid1.Nrow, lgxgrid1.Nlist, (lgxgrid1.GetLAlignment(lgxgrid1.Nrow, lgxgrid1.Nlist) + 1)
End Sub
Private Sub d2_Click()
p = lgxgrid1.GetTAlignment(lgxgrid1.Nrow, lgxgrid1.Nlist) + 1
lgxgrid1.SetTAlignment lgxgrid1.Nrow, lgxgrid1.Nlist, (lgxgrid1.GetTAlignment(lgxgrid1.Nrow, lgxgrid1.Nlist) + 1)
End Sub
Private Sub d3_Click()
Dim i As Long
Dim j As Long
Dim n1 As Long
Dim n2 As Long
Dim l1 As Long
Dim l2 As Long
n1 = lgxgrid1.Nrow
n2 = lgxgrid1.NrowEnd
l1 = lgxgrid1.Nlist
l2 = lgxgrid1.NlistEnd
For i = n1 To n2
For j = l1 To l2
lgxgrid1.SbackColor i, j, &HFF88FF
Next
Next
End Sub
Private Sub d4_Click()
Dim i As Long
Dim j As Long
Dim n1 As Long
Dim n2 As Long
Dim l1 As Long
Dim l2 As Long
n1 = lgxgrid1.Nrow
n2 = lgxgrid1.NrowEnd
l1 = lgxgrid1.Nlist
l2 = lgxgrid1.NlistEnd
For i = n1 To n2
For j = l1 To l2
lgxgrid1.SForeColor i, j, &HFF00FF
Next
Next
End Sub
Private Sub Dx_Click()
'Dim Base64S
'Set reData = lgxgrid1.ToGetWeb("http://192.168.85.1/webform/DataService.asmx/ReadImg?Id=1", "XML", "Text", "<Root><Record><Root></Record>")
'Base64S = reData.childNodes(0).childNodes(0).Text
'Dim ImgData
'Dim ImgDatax
'ImgData = lgxgrid1.Base64StringToByte(Base64S)
'ImgData = lgxgrid1.ByteToBase64String(FileGetOnt1.GetData("c:\xx.jpg"))
' MsgBox ImgData
'ImgDatax = lgxgrid1.Base64StringToByte(ImgData)
'MsgBox (FileGetOnt1.OutFile("c:\xxyy.gif", ImgDatax))
End Sub
Private Sub f0_Click()
lgxgrid1.OrderList lgxgrid1.Nrow, lgxgrid1.NrowEnd, lgxgrid1.Nlist, LgxgridV10.px.Depress, LgxgridV10.pxmode.CharacterMode
End Sub
Private Sub f1_Click()
Dim i As Long
Dim ins As Long
Dim ints As Long
ints = lgxgrid1.Nrow
ins = lgxgrid1.NrowEnd
For i = ints To ins
lgxgrid1.DelRow (ints)
Next
End Sub
Private Sub f10_Click()
lgxgrid1.ListLineAdd lgxgrid1.Nlist, 1, &HFF
End Sub
Private Sub f11_Click()
lgxgrid1.ListLineUnload lgxgrid1.Nlist
End Sub
Private Sub f12_Click()
Dim hf As New StdFont
hf.Name = "隶书"
hf.Size = 12
lgxgrid1.SetHeadText 1, 3, "班级名称", hf
End Sub
Private Sub f13_Click()
MsgBox (lgxgrid1.GetHeadText(lgxgrid1.Nrow, lgxgrid1.Nlist))
End Sub
Private Sub f14_Click()
lgxgrid1.SetArea lgxgrid1.Nrow, 1, lgxgrid1.Nrow, lgxgrid1.lists
End Sub
Private Sub f15_Click()
Dim i As Long
Dim j As Long
For i = lgxgrid1.Nrow To lgxgrid1.NrowEnd
For j = lgxgrid1.Nlist To lgxgrid1.NlistEnd
lgxgrid1.SetGridEditStyle i, j, True
Next
Next
End Sub
Private Sub f16_Click()
trow = InputBox("row")
tlist = InputBox("list")
MsgBox (lgxgrid1.GetData(trow, tlist))
lgxgrid1.Visible = True
End Sub
Private Sub f17_Click()
'lgxgrid1.SetData 300, 3, "xyz"
'For i = 1 To 300
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -