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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Properties

Status
Not open for further replies.

BeerFizz

Technical User
Joined
Jan 23, 2004
Messages
28
Hi,

How can I change the properties of any text in a window. eg, change the text to a different font, change the point size, change the color etc.

Thanks
for your help
Phil
 
Code:
// let's BOLD the amount edit field identified by the IDES_AMOUNT, 
	CFont l_BoldFont;
	CFont* l_pOriginalFont;
	LOGFONT LogFont;
	l_pOriginalFont = GetDlgItem(IDES_AMOUNT)->GetFont();
	l_pOriginalFont->GetLogFont( &LogFont );

	l_BoldFont.CreateFont
	(	
		LogFont.lfHeight,
		LogFont.lfWidth,
		LogFont.lfEscapement,
		LogFont.lfOrientation,
		FW_BOLD,
		LogFont.lfItalic,
		LogFont.lfUnderline,
		LogFont.lfStrikeOut,
		LogFont.lfCharSet,
		LogFont.lfOutPrecision,
		LogFont.lfClipPrecision,
		LogFont.lfQuality,
		LogFont.lfPitchAndFamily,
		LogFont.lfFaceName
	);

	GetDlgItem(IDES_AMOUNT)->SetFont(&l_BoldFont,TRUE);

-obislavu-
 
Thank You for your help

Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top