Assigning color to cell on grid.
Hi all,
I have this code.
VB Code:
For i = 0 To grdDiary.Rows - 1
' Selects the disired row.
grdDiary.Row = i
' Sets the text on the row
grdDiary.Text = DateAdd("d", i - 1, sMonth)
' If the text on the row is the same as todays date
If grdDiary.Text = CStr(DateTime.Date) Then
' ????
Else
' ????
End If
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
Re: Assigning color to cell on grid.
Quote:
Originally Posted by juniorCoder001
its a standard vb6 grid.
Welcome :wave:
There are a number of grids: MSFlexGrid, MSHFlexGrid, Grid, which one are you using?
Re: Assigning color to cell on grid.
Re: Assigning color to cell on grid.
Does anyone have any ideas?
Re: Assigning color to cell on grid.
Do U Want To Cahnge The Grid Cell Colour
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...
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/