Dear all,
Do anyone have any ideas on how to save and load colors into flexgrid's cells?
Printable View
Dear all,
Do anyone have any ideas on how to save and load colors into flexgrid's cells?
Do you mean changing the CellBackColor?
Here some examples.. ;)
VB Code:
'This will change de CellBackColor of cell 2,2 Private Sub Command1_Click() With MSFlexGrid1 .Redraw = False 'No redraw while changing colors .Row = 2 .Col = 2 .CellBackColor = vbGreen 'Paint it green .Redraw = True 'Redraw again End With End Sub 'This will change de CellBackColor of the entire Flexgrid Private Sub Command2_Click() With MSFlexGrid1 .Redraw = False 'No redraw while changing colors .FillStyle = flexFillRepeat 'This will apply to the entire grid .Row = 1 'the order is important -> Row, Col, Rowsel, Colsel .Col = 0 .RowSel = .Rows - 1 .ColSel = .Cols - 1 .CellBackColor = vbYellow 'Paint it Yellow .FillStyle = flexFillSingle 'Restore cell level changes .Redraw = True 'Redraw again End With End Sub
Thats to set the CellbackColor, and the same way, using .Row and .Col you can position in specific cells and get the color with .CellBackColor. This property Sets and Returns the cellbackcolor, then you can Save it somewhere, or Load it from somewhere.