Results 1 to 3 of 3

Thread: save and load colors into flexgrid cells

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    1

    save and load colors into flexgrid cells

    Dear all,
    Do anyone have any ideas on how to save and load colors into flexgrid's cells?

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: save and load colors into flexgrid cells

    Do you mean changing the CellBackColor?

  3. #3
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: save and load colors into flexgrid cells

    Here some examples..
    VB Code:
    1. 'This will change de CellBackColor of cell 2,2
    2. Private Sub Command1_Click()
    3.     With MSFlexGrid1
    4.         .Redraw = False              'No redraw while changing colors
    5.         .Row = 2
    6.         .Col = 2
    7.         .CellBackColor = vbGreen     'Paint it green
    8.         .Redraw = True               'Redraw again
    9.     End With
    10. End Sub
    11.  
    12. 'This will change de CellBackColor of the entire Flexgrid
    13. Private Sub Command2_Click()
    14.     With MSFlexGrid1
    15.         .Redraw = False                      'No redraw while changing colors
    16.         .FillStyle = flexFillRepeat          'This will apply to the entire grid
    17.  
    18.             .Row = 1                         'the order is important -> Row, Col, Rowsel, Colsel
    19.             .Col = 0
    20.             .RowSel = .Rows - 1
    21.             .ColSel = .Cols - 1
    22.             .CellBackColor = vbYellow        'Paint it Yellow
    23.            
    24.         .FillStyle = flexFillSingle 'Restore cell level changes
    25.         .Redraw = True 'Redraw again
    26.     End With
    27. 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.
    Last edited by jcis; Nov 25th, 2005 at 12:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width