|
-
April 8th, 1999, 08:31 AM
#1
How to change font in ListCtrl
Hi!
I have code:
CFont Font;
if( Font.CreateFont( 20, //int nHeight,
30, //int nWidth,
0, //int nEscapement,
0, //int nOrientation,
0, //int nWeight,
1, //BYTE bItalic,
0, //BYTE bUnderline,
0, //BYTE cStrikeOut,
1, // BYTE nCharSet,
OUT_DEFAULT_PRECIS, //BYTE nOutPrecision,
CLIP_DEFAULT_PRECIS, //BYTE nClipPrecision,
DEFAULT_QUALITY, //BYTE nQuality,
VARIABLE_PITCH | TMPF_TRUETYPE, //BYTE nPitchAndFamily,
"Arial" //LPCTSTR lpszFacename
))
m_Table.SetFont( &Font, true );
This code does not change font (and size). What is wrong?
I know it is simple. Help, please.
Best regards, Bob.
-
April 8th, 1999, 11:23 AM
#2
Re: How to change font in ListCtrl
The CFont object must live as long as the CListCtrl object does. This means, the CFont must be a member of the same class the CListCtrl is, or be a (ugh) global variable, or be (ugh) a static variable within a function.
Make the CFont a member of the class and that should fix it.
LA Leonard - Definitive Solutions, Inc.
-
April 9th, 1999, 01:51 AM
#3
Re: How to change font in ListCtrl
Gotcha.
Best regards, Bob.
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
|