MSFlexGrid

Dazz
09-14-2000, 09:11 AM
I am using 2 MSFlexGrid's in a app that I am doing.

The programs compares the data in col 1 for each row, if a match occures I want the whole row on both grids to change colour. So what I end up with is multiple matches on both grids highlighted in different colours.

I can do all but the colour bit, I can't get one row to change colour, only all of it.

Can this be done, or do I need to be looking at a differnt control ?

whelanp
09-14-2000, 09:31 AM
to colour a single row in an msFlexgrid,

Use something like the following:

Public Sub ColourRow(ByVal intRow As Integer, ByVal varColour As Variant, ByVal grdData As MSFlexGrid)

' Colour row "intRow" to "varColour" in grid grdData

On Error GoTo ProcErr

Dim intLoop As Integer

With grdData

.Row = intRow

For intLoop = 0 To .Cols - 1
.Col = intLoop
.CellForeColor = varColour
Next intLoop

End With


ProcExit:
Exit Sub

ProcErr:
Resume ProcExit
End Sub


Hope it helps..

Dazz
09-14-2000, 09:42 AM
You know what, I must be getting old (turned 30 couple weeks ago).

The app I am doing is loading a Pegasus Operations FoxPro database through DAO and using SQL to load 2 products, and then loading the products Bill of Materials into 2 FlexGrids and comparing the component lists to compare the cost and component usage familiarities.

And I could'nt find the .CellForeColor command.

Head hanging in shame!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum