hoosier121
MIS
Hi all,
With the help of the great experts here I have been able to make a distinct row color for the selected row of a grid. What I want to do now is make the selected cell different than even the row color. I have been able to make it white, but when I try another RGB I get funky results. Here is my code so far...
** dataentrygrid.init
** Code to set the color of a selected row
cForeColor = "IIF(RECNO(This.RecordSource) = This.InRecNo, "
cForeColor = cForeColor + "RGB(255,255,255), RGB(0,0,0))" && White and Black
cBackColor = "IIF(RECNO(This.RecordSource) = This.InRecNo, "
cBackColor = cBackColor + "RGB(128,128,255), RGB(255,255,255))" && LightPurple and White
WITH This
.Inrecno = RECNO(.RecordSource)
.SetAll('DynamicForeColor', cForeColor, 'COLUMN')
.SetAll('DynamicBackColor', cBackColor, 'COLUMN')
ENDWITH
This.SetAll([SelectedBackColor],RGB(255,255,255))
This.SetAll([SelectedForeColor],RGB(0,0,0))
** dataentrygrid.AfterRowColChange
This.InRecNo = RECNO()
This.Refresh() John
Everything I needed to know I learned from Yoda.
With the help of the great experts here I have been able to make a distinct row color for the selected row of a grid. What I want to do now is make the selected cell different than even the row color. I have been able to make it white, but when I try another RGB I get funky results. Here is my code so far...
** dataentrygrid.init
** Code to set the color of a selected row
cForeColor = "IIF(RECNO(This.RecordSource) = This.InRecNo, "
cForeColor = cForeColor + "RGB(255,255,255), RGB(0,0,0))" && White and Black
cBackColor = "IIF(RECNO(This.RecordSource) = This.InRecNo, "
cBackColor = cBackColor + "RGB(128,128,255), RGB(255,255,255))" && LightPurple and White
WITH This
.Inrecno = RECNO(.RecordSource)
.SetAll('DynamicForeColor', cForeColor, 'COLUMN')
.SetAll('DynamicBackColor', cBackColor, 'COLUMN')
ENDWITH
This.SetAll([SelectedBackColor],RGB(255,255,255))
This.SetAll([SelectedForeColor],RGB(0,0,0))
** dataentrygrid.AfterRowColChange
This.InRecNo = RECNO()
This.Refresh() John
Everything I needed to know I learned from Yoda.