Objective Grid: How can I change cell settings (e.g. colors) for individual cells?

Article ID: 350
Last updated: 07 Jun, 2018
Article ID: 350
Last updated: 07 Jun, 2018
Revision: 3
Views: 2854
Posted: 11 Jan, 2001
by Meltreger B.
Updated: 07 Jun, 2018
by Meltreger B.

Problem


How can I change cell settings (e.g. colors) for individual cells?


Cause



Action


Use the SetStyleRange() command to change cell settings. The SetInterior() and SetTextColor() methods of the CGXStyle class let you change colors.

Here is an example:
 

SetStyleRange(CGXRange(nRow, nCol), CGXStyle( )
.SetInterior(RGB(255, 255, 255))
.SetTextColor(RGB(0, 0, 0)));

If you want to use system colors use the GXSYSCOLOR macro.
 

SetStyleRange(CGXRange(nRow, nCol), CGXStyle( )
.SetInterior(GXSYSCOLOR(SYSCOLOR_WINDOW))
.SetTextColor(GXSYSCOLOR(SYSCOLOR_WINDOWTEXT)));


 

This article was:   Helpful | Not helpful
Report an issue
Article ID: 350
Last updated: 07 Jun, 2018
Revision: 3
Views: 2854
Posted: 11 Jan, 2001 by Meltreger B.
Updated: 07 Jun, 2018 by Meltreger B.

Others in this category