CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: data grid

  1. #1
    Join Date
    Mar 2001
    Posts
    29

    data grid

    is there any way to alternate the background color of a grid. one row white the next light blue..... easily. I dont want it to cause a speed problem.


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: data grid

    Here is an example how to do it for MSFlexGrid

    Public Sub MSFlexGridColors(ColorGrid As MSFlexGrid, R As Integer, G As Integer, B As Integer)

    For j = 0 To ColorGrid.Cols - 1
    For i = 1 To ColorGrid.Rows - 1
    If i / 2 <> Int(i / 2) Then
    ColorGrid.Col = j
    ColorGrid.Row = i
    ColorGrid.CellBackColor = RGB(R, G, B)
    End If
    Next i
    Next j
    End Sub


    'Then use this code to activate the SUB:

    MSFlexGridColors MSFlexGrid, Red, Green, Blue
    for example:
    MSFlexGridColors Form1.MSFlexGrid, 192, 255, 192'(green/white)


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured