Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make selected cell different from selected row color 2

Status
Not open for further replies.
Apr 12, 2002
31
US
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

[pc] Everything I needed to know I learned from Yoda.
 
Hi Try.. the following..

In Grids AfterRowColChangeEvent..
This.Columns(This.ActiveColumn).Text1.BackColor = ;
RGB(255,0,0) && put whatever you want.

Assumed your forecolor is Black.. This should be Ok. As you skip thru the columns.. you should get RED back color in the above case. You may have to set the SELECTED BACKCOLOR same as the one described here to have some the same effect. :)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Thanks guys,
My distinct color is working great now. John

[pc] Everything I needed to know I learned from Yoda.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top