Click here to Skip to main content
16,005,080 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to Create A Shared Folder Pin
f29-Jun-05 6:41
f29-Jun-05 6:41 
GeneralailFreeing memory Pin
laiju9-Jun-05 4:57
laiju9-Jun-05 4:57 
GeneralRe: ailFreeing memory Pin
Cedric Moonen9-Jun-05 5:05
Cedric Moonen9-Jun-05 5:05 
GeneralRe: ailFreeing memory Pin
Budric B.9-Jun-05 5:13
Budric B.9-Jun-05 5:13 
GeneralRead a line from a text file Pin
bkphat9-Jun-05 4:34
bkphat9-Jun-05 4:34 
GeneralRe: Read a line from a text file Pin
toxcct9-Jun-05 5:18
toxcct9-Jun-05 5:18 
GeneralRe: Read a line from a text file Pin
James R. Twine9-Jun-05 5:49
James R. Twine9-Jun-05 5:49 
GeneralChanging the font of a control ( CStatic ) Pin
Maximilien9-Jun-05 4:34
Maximilien9-Jun-05 4:34 
I'm not sure I'm doing the right thing.

I have a CStatic in a dialog ( with the associated variable in the dialog class ), and I want to change the "weight" of the font of the CStatic, make it bold or normal depending on a state.

Can I do something like :

// a user pressed a button to make the CStatic bold...
 CFont* font = m_MaxStatic.GetFont();
 LOGFONT logFont;

 font->GetLogFont( &logFont );
 logFont.lfWeight = FW_BOLD;

 CFont newFont;
 newFont.CreateFontIndirect( &logFont );
 m_MaxStatic.SetFont(&newFont);


when I do the above, the font seems ok, it appears bold, but if the dialogs ( or the control ) gets invalidated, the font (size) is different.

Do I need to make the 2 different fonts (normal and bold) class members ( of either the dialog or a derived CStatic class ) ? or is there a better way to dinamically change the font of a control ?

Should there be a functional difference between small fonts vs. large fonts.

Thanks a lot.


Maximilien Lincourt
Your Head A Splode - Strong Bad
GeneralRe: Changing the font of a control ( CStatic ) Pin
James R. Twine9-Jun-05 4:42
James R. Twine9-Jun-05 4:42 
GeneralRe: Changing the font of a control ( CStatic ) Pin
Maximilien9-Jun-05 5:32
Maximilien9-Jun-05 5:32 
GeneralRe: Changing the font of a control ( CStatic ) Pin
James R. Twine9-Jun-05 5:45
James R. Twine9-Jun-05 5:45 
GeneralRe: Changing the font of a control ( CStatic ) Pin
Michael Dunn9-Jun-05 6:55
sitebuilderMichael Dunn9-Jun-05 6:55 
GeneralRe: Changing the font of a control ( CStatic ) Pin
Maximilien9-Jun-05 7:04
Maximilien9-Jun-05 7:04 
GeneralMSVCIRT error Pin
ronwurster9-Jun-05 4:06
ronwurster9-Jun-05 4:06 
GeneralRe: MSVCIRT error Pin
Blake Miller9-Jun-05 6:29
Blake Miller9-Jun-05 6:29 
Generalimage processing Pin
Arrun9-Jun-05 2:25
Arrun9-Jun-05 2:25 
GeneralRe: image processing Pin
Member 14276929-Jun-05 2:47
Member 14276929-Jun-05 2:47 
GeneralLoad msword doc files in mfc Pin
GnanaprakashJebaraj9-Jun-05 2:15
GnanaprakashJebaraj9-Jun-05 2:15 
GeneralRe: Load msword doc files in mfc Pin
David Crow9-Jun-05 2:23
David Crow9-Jun-05 2:23 
GeneralRe: Load msword doc files in mfc Pin
GnanaprakashJebaraj10-Jun-05 1:30
GnanaprakashJebaraj10-Jun-05 1:30 
GeneralRe: Load msword doc files in mfc Pin
David Crow10-Jun-05 5:51
David Crow10-Jun-05 5:51 
GeneralRe: Load msword doc files in mfc Pin
ThatsAlok9-Jun-05 18:32
ThatsAlok9-Jun-05 18:32 
GeneralRe: Load msword doc files in mfc Pin
GnanaprakashJebaraj10-Jun-05 1:34
GnanaprakashJebaraj10-Jun-05 1:34 
GeneralRe: Load msword doc files in mfc Pin
ThatsAlok10-Jun-05 1:40
ThatsAlok10-Jun-05 1:40 
GeneralRe: Load msword doc files in mfc Pin
GnanaprakashJebaraj15-Jun-05 20:34
GnanaprakashJebaraj15-Jun-05 20:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.