Hi
MS flexgrid colouring can be made much faster using the redraw property and the fillstyle. Here are some examples of a 0 to 5 column flexgrid
VB Code:
'This section just fills the grid
Private Sub Command1_Click()
With MSFlexGrid1
.Redraw = False 'Halts redraws until complete
.Rows = 0
For x = 0 To 999
.AddItem x & vbTab & x & vbTab & x & vbTab & x & vbTab & x & vbTab & x
Next
.Redraw = True
End With
End Sub
This section colours each item by row. If you are doing specific things to specific rows then this will be appropriate
VB Code:
Private Sub Command2_Click()
With MSFlexGrid1
.Redraw = False
.FillStyle = flexFillRepeat 'Set fill style
For x = 0 To 999
.Row = x
.Col = 0 'Used with fill style for first col
.ColSel = 5 'used with fill style for last col
.CellBackColor = vbRed 'Colours whole row 0 to 5
Next
.Redraw = True
End With
End Sub
If you only want to colour a specific column and u have many rows it is much faster to colour by column.
VB Code:
Private Sub Command3_Click()
With MSFlexGrid1
.Redraw = False
.FillStyle = flexFillRepeat
For x = 0 To 5
.Col = x
.Row = 0
.RowSel = 999
.CellBackColor = vbRed
Next
.Redraw = True
End With
End Sub
Both methods are acceptably fast if redraw is set to false and true as appropriate
Regards
Stuart