Private Oper_ID As Variant
Private Oper_Name As Variant
Private Oper_Pass As Variant
Private Sub IniFlexGrid(ByVal flexGrid As MSHFlexGrid) //这是建立FlexGrid表的一个过程(他的字段为编号,姓名,密码)
flexGrid.Clear
With flexGrid
.Cols = 4 //定义FlexGrid表列数为4行
.Rows = 2 //定义FlexGrid表行数为2行
.FixedCols = 0
.FixedRows = 1
.SelectionMode = flexSelectionByRow //定义表选择方式为整行选择
.TextMatrix(0, 1) = "编号" //插入头一个字段为编号
.TextMatrix(0, 2) = "姓名" //插入第二个字段为姓名
.TextMatrix(0, 3) = "密码" //插入第三个字段为密码
.ScrollBars = flexScrollBarVertical //表滚动条为垂直
.GridLines = flexGridNone //不显示分隔线
.GridLinesFixed = flexGridNone
'.AllowBigSelection = True
.AllowUserResizing = flexResizeNone
.ColWidth(0) = 1 //第一列宽度1像素
.ColWidth(1) = 1000 //第二列宽度1000像素
.ColWidth(2) = 2000 //第三列宽度2000像素
.ColWidth(3) = 3420 //第四列宽度3420像素
.ColAlignment(1) = 3
.ColAlignment(2) = 0
.ColAlignment(3) = 0
.ColAlignmentFixed(1) = 3
.FillStyle = flexFillSingle
.ScrollTrack = True
.Row = 1
.Col = 0
.RowSel = 1
.ColSel = .Cols - 1
End With
End Sub
这段代码没有什么 就是把内容填写至表格控件啊。