
Originally Posted by
kusumat
Hi,
i want the procedure to change the text color in numeric editor.
By default it is displaying green.
I want to change it to black
Regards,
Kusuma
Below code can set text font and text color for CEikEdwin
Code:
void SetFont(const CFont* aFont,TRgb aFontColor)
{
if(!aFont)
return;
TFontSpec fontspec = aFont->FontSpecInTwips();
TCharFormat charFormat( fontspec.iTypeface.iName, fontspec.iHeight );
TCharFormatMask charFormatMask;
charFormat.iFontPresentation.iTextColor = aFontColor;
charFormatMask.SetAttrib(EAttFontTypeface);
charFormatMask.SetAttrib(EAttFontHeight);
charFormatMask.SetAttrib(EAttColor);
CCharFormatLayer* formatLayer = CCharFormatLayer::NewL(charFormat,charFormatMask);
iEditor->SetCharFormatLayer(formatLayer);
}