CGXStyle& SetIncludeNegativeStateColor (BOOL b);
b
TRUE if NegativeStateColor should be marked as initialized; FALSE otherwise.
Returns the this pointer.
Specifies the include state for the NegativeStateColor property.
If you fill the grid in "virtual mode" then setting this attribute will not work.
For virtual mode, you should set this attribute in the style in your GetSTyleRowCol, ComposeStyleRowCol or OnLoadCellStyle override, after you supply the data.
void CMyGrid::ComposeStyleRowCol(ROWCOL nRow, ROWCOL nCol, CGXStyle* pStyle, BOOL bApplyStandard)
{
<Call your base class and supply data (if appropriate)>
.......
if(!(IsCurrentCell(nRow, nCol) && pStyle->GetIncludeControl() && GetRegisteredControl(pStyle->GetControl())->IsActive()))
{
if(pStyle->GetIncludeValue()
&& pStyle->GetIncludeNegativeStateColor()
&& _gxttof(pStyle->GetValue()) < 0
)
{
DWORD csColor ;
csColor = pStyle->GetNegativeStateColor();
pStyle->SetTextColor(csColor);
}
}
}
Class Overview | Class Members