?? 窗體內隔行顏色.txt
字號:
'設置窗體內數據隔行顯示顏色不同
Sub SetGridColor(GRID As Control, row_col As Boolean, color1 As Long, color2 As Long)
Dim i As Integer
Dim j As Integer
Dim K As Long
GRID.Redraw = False
With GRID
If row_col Then '行間隔顏色
For i = .FixedRows To .Rows - 1
If K = color2 Then
K = color1
Else
K = color2
End If
For j = .FixedCols To .Cols - 1
.Col = j
.Row = i
.CellBackColor = K
Next
.RowHeight(i) = 280
Next
.Redraw = True
else
For i = .FixedCols To .Cols - 1 '列間隔顏色
If K = color2 Then
K = color1
Else
K = color2
End If
For j = .FixedRows To .Rows - 1
.Col = i
.Row = j
.CellBackColor = K
Next
Next
.Redraw = True
End If
End With
End Sub
'調用
Call SetGridColor(grid1, True, &HD0FFE0, &HDFFFFF) '行間隔色不同
Call SetGridColor(grid1, flase, &HD0FFE0, &HDFFFFF) '列間隔色不同
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -