For i = 1 To .Rows - 1 .RowHeight(i) = 300 '设置行高 Next i For i = 0 To 1 .TextMatrix(i, 0) = "上月" & vbCrLf & "结存数量" '//换行 .FixedAlignment(0) = 4 Next i For i = 0 To 1 .TextMatrix(i, 5) = "月末结存" .FixedAlignment(5) = 4 Next i For i = 1 To 4 .TextMatrix(0, i) = "本月进销存数量" .ColAlignment(i) = 4 Next i
.MergeCells = flexMergeFree ' .MergeCells = flexMergeFixedOnly .MergeCol(0) = True .MergeRow(0) = True .MergeCol(5) = True End With End Sub
请问:如何使用 VSFlexGrid Pro 分级显示和存取数据库中的数据。类似于《让 TreeView 支持无限级分类》帖子中所介绍的使用树形控件显示和存取数据库的数据。
Dim cn as New ADODB.Recordset Dim rs As New ADODB.Recordset Dim lngY As Long Dim intT As Integer cn.open "............" rs.Open "select 系统编号 from test order by 系统编号", cn With VSFlexGrid1 Set .DataSource = rs .RowOutlineLevel(1) = 1 .IsSubtotal(1) = True
For lngY = 1 To .Rows - 1 intT = Len(.TextMatrix(lngY, 0)) - Len(Replace(.TextMatrix(lngY, 0), ".", ""))