Results 1 to 2 of 2

Thread: Cell Back Color of FlexGrid

  1. #1
    747
    Guest

    Arrow Cell Back Color of FlexGrid

    Hi all,

    How do we change a back color of a cell in MSHFLEXGRID during run time

    Thanks

  2. #2
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi
    Check out the Cell[...] group of items in help. One of these is CellBackColor. Here is some code. Note that to colour a row u must set the col and colsel after the row and vice versa for a column
    Regards
    Stuart
    VB Code:
    1. Private Sub Command1_Click()
    2.     'Colour a cell
    3.     With MSFlexGrid1
    4.         .Col = 1
    5.         .Row = 1
    6.         .CellBackColor = vbRed
    7.     End With
    8.    
    9.     'Colour a row
    10.     With MSFlexGrid1
    11.         .FillStyle = flexFillRepeat
    12.         .Row = 1
    13.         .Col = 1
    14.         .ColSel = 3
    15.         .CellBackColor = vbRed
    16.     End With
    17.  
    18.     'Colour a column
    19.     With MSFlexGrid1
    20.         .FillStyle = flexFillRepeat
    21.         .Col = 1
    22.         .Row = 1
    23.         .RowSel = 3
    24.         .CellBackColor = vbRed
    25.     End With
    26. End Sub
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

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