|
-
May 14th, 1999, 04:32 PM
#1
how can I underline, bold and italics a word in a SDI child area
To print text to the SDI child area, I typed;
OnDraw()
{
CFont newFont;
newFont.CreatePointFont(100, "Times New Roman");
CFont *pOldFont = pDC->SelectObject(&newFont);
pDC->TextOut(5, 5, "Text to screen");
pDC->SelectObject(pOldFont);
newFont.DeleteObject();
}
How can I adjust this code so that a word is underlined, in bold,
italics, or all of the above?
Any response any one can give me will be greatly appreciated.
-
May 14th, 1999, 04:59 PM
#2
Re: how can I underline, bold and italics a word in a SDI child area
use createfont instead of createpointfont:
BOOL CreateFont( int nHeight, int nWidth, int nEscapement, int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline, BYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision, BYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily, LPCTSTR lpszFacename );
You then can set flags for italic and underline, and the font weight for bold (FW_BOLD).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|