文档介绍:fpvaspread 详解
With vaspread
.DeleteRows 1, 1 --删除第一列第一行数据
.Col = -1: .Row = -1: .Lock = False --设置vaspread为解锁状态
.AllowUserFormulas = False ‘不允许格式化
.MaxCols = 67 '58 ‘设置最大列数
.MaxRows = 300 ‘设置显示行的最大数
.ColHeaderRows = 1 ' 2 将头换成1行
.UserColAction = UserColActionSort '表头是否排序
' .AddCellSpan 1, SpreadHeader, 17, 1 '16 change 17 ‘设置显示标题栏格式
' .Col = 1: .Row = SpreadHeader: .Text = "基本信息" ‘设置列名
.Col = COL_ID: .Row = SpreadHeader: .Text = "序号" 'SpreadHeader + 1 控制显示的行
'SpreadHeader + 1 DateField 为绑定的数据表字段 colhidden是否为隐藏
‘Colwidth 设置显示的列的宽度
.Col = COL_FID: .Row = SpreadHeader: .DataField = "FID": .Text = "表体唯一号": .ColHidden = True :。ColWidth(1)=12 '‘SpreadHeader + 1
‘ = CellTypeDate 日期
.Col = FhwBoolIn(2, "FStartDate"): .CellType = CellTypeDate: .TypeDateFormat = TypeDateFormatYYMMDD
‘ = CellTypeNumber
'.Col = FhwBoolIn(2, "FThickness"): .CellType = CellTypeNumber: .TypeNumberDecPlaces = 2: .TypeNumberShowSep = True: .TypeHAlign = TypeHAlignRight
‘ = CellTypeEdit:
.Col = FhwBoolIn(2, "FDescriptionCust"): .TypeEditMultiLine = True: .CellType = CellTypeEdit: .AutoSize = True
‘自动换行换列
Private Sub EntrerCtrlCol(ByVal KeyCode As Long) 'Enter 换行
With vaspread
If KeyCode = 13 Then ‘获取回车事件
If .MaxCols <> .ActiveCol Then 。如果当前列不等于最大列,则换行否则换列
.SetActiveCell .ActiveCol + 1, .ActiveRow
.SetFocus
Else
.SetAct