Results 1 to 7 of 7

Thread: Assigning color to cell on grid.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    4

    Assigning color to cell on grid.

    Hi all,

    I have this code.

    VB Code:
    1. For i = 0 To grdDiary.Rows - 1
    2.      
    3.       ' Selects the disired row.
    4.       grdDiary.Row = i
    5.  
    6.       ' Sets the text on the row
    7.       grdDiary.Text = DateAdd("d", i - 1, sMonth)
    8.      
    9.       ' If the text on the row is the same as todays date
    10.       If grdDiary.Text = CStr(DateTime.Date) Then
    11.         ' ????
    12.       Else
    13.         ' ????
    14.       End If
    15.      
    16. Next i
    Basically the loop will run through each row setting every date in the month on the left column, what I want it to do is when it finds todays date, highlight it in some way.

    The text cannot change, but it can change color or I could place an picture behind it. I just want the cell to be highlighted, not the row.

    its a standard vb6 grid.

    Any ideas?

    Many thanks in advance...

    Mark

  2. #2
    Frenzied Member SeanK's Avatar
    Join Date
    May 2002
    Location
    Boston MA
    Posts
    1,160

    Re: Assigning color to cell on grid.

    Quote Originally Posted by juniorCoder001
    its a standard vb6 grid.
    Welcome

    There are a number of grids: MSFlexGrid, MSHFlexGrid, Grid, which one are you using?
    Beantown Boy
    Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    4

    Re: Assigning color to cell on grid.

    Hi

    Its grid.

    Mark

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    4

    Re: Assigning color to cell on grid.

    Does anyone have any ideas?

  5. #5
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Assigning color to cell on grid.

    Do U Want To Cahnge The Grid Cell Colour

  6. #6

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    4

    Re: Assigning color to cell on grid.

    Yeah, basically its a grid that has a column of dates down the left hand side and there are as many rows as there are dates in a particular month, then along the top is the amount of days in the month.

    Its for assigning work to employees, however the users want the cell that holds the current date (down the lefthand side) to be highlighted in some way, so a different color would work fine.

    I'm a little stuck on this...

  7. #7
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Assigning color to cell on grid.

    For changing u can use VSFlexGrid from Here It is batter then grid

    http://www.softlookup.com/windows/

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