-
05-0322
-
Public Function FlexRedraw(F As MSHFlexGrid) As String
With F
.Redraw = False ‘禁止重画,防止闪动
.BackColorFixed = RGB(190, 218, 178) ‘标题行背景色
.Row = 0 ‘设置标题行文字的对其方式
.Col = 0
.ColSel = .Cols – 1
.CellForeColor = vbBlue ‘标题行文字颜色
.CellAlignment = 4 ‘对其方式为中间中间
.ScrollTrack = True ‘移动滚动条的同时数据也滚动
For I = .FixedRows To .Rows – 1 ‘单双行表格条纹背景色显示
.Row = I ‘选择第I行
.Col = .FixedCols
.ColSel = .Cols – 1
If I / 2 = Int(I / 2) Then ‘判断是单是双
.CellBackColor = RGB(224, 248, 224) ‘双行的底色
Else
.CellBackColor = RGB(240, 248, 224) ‘单行的底色
End If
Next I
.Row = 1
.Col = 1
.ColSel = .Cols – 1
.Redraw = True ‘允许重画,显示表格
End With
End Function
Tags: mshflexgrid, VB
相关日志
发表评论






- 评论 (0)
- 引用通告 (0)
发表评论 发起引用