1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Private Sub ColorGridline(ByRef MSHGrid As MSHFlexGrid, ByVal irow As Long, ByVal BkColor As Long)
Dim icol As Integer
Dim memRow As Integer, memCol As Integer
With MSHGrid
.Redraw = False
.Row = irow
For icol = 1 To .Cols - 1
.Col = icol
.CellBackColor = BkColor
Next icol
.Redraw = True
End With
End Sub
Private Sub Command1_Click()
rs.MoveFirst
While Not rs.EOF
If rs.Fields("Nomduchamp").Value = -1 Then
ColorGridline MSHGrid1, rs.AbsolutePosition, vbGreen
Else
ColorGridline MSHGrid1, rs.AbsolutePosition, vbRed
End If
rs.MoveNext
Wend
End Sub |
Partager