Click here to Skip to main content
15,910,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Parsing in C Pin
Erudite_Eric29-Jan-12 21:10
Erudite_Eric29-Jan-12 21:10 
AnswerRe: Parsing in C Pin
David Crow27-Jan-12 9:38
David Crow27-Jan-12 9:38 
GeneralRe: Parsing in C Pin
Software200727-Jan-12 9:52
Software200727-Jan-12 9:52 
GeneralRe: Parsing in C Pin
David Crow27-Jan-12 10:09
David Crow27-Jan-12 10:09 
Questionread/write disk sectors Pin
RomTibi27-Jan-12 7:21
RomTibi27-Jan-12 7:21 
QuestionProcess not entirely exiting Pin
Joe Woodbury27-Jan-12 5:49
professionalJoe Woodbury27-Jan-12 5:49 
AnswerRe: Process not entirely exiting Pin
Randor 27-Jan-12 6:33
professional Randor 27-Jan-12 6:33 
QuestionSet the font for text Pin
MKC00226-Jan-12 18:05
MKC00226-Jan-12 18:05 
I am trying to set the font for radio button using below code in my project but font does not set. Font and color does not set for text on radio button.

I have a dialog base application (MFC), at dialog there are some radio buttons
In dialog class, Oninitdialog() i use

CFont* pFont = GetDlgItem( IDC_RADIO1 )->GetFont();
LOGFONT LogFont = { 0 };
pFont->GetLogFont( &LogFont );
LogFont.lfItalic = TRUE;
LogFont.lfWidth = 9;
LogFont.lfHeight = 12;
LogFont.lfWeight = FW_BOLD;
memcpy(LogFont.lfFaceName,"Verdana",7);
m_StaticFont.CreateFontIndirect( &LogFont );
GetDlgItem( IDC_RADIO1 )->SetFont( &m_StaticFont );

in header file
CFont m_StaticFont;

To set the color for text on radio button, i use OnCtlColor (WM_CTLCOLOR)
HBRUSH CtestxmlDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
///
if(pWnd->GetDlgCtrlID() == IDC_RADIO1)
pDC->SetTextColor(RGB(255,0,0));
////
}

But when i use above code in a test program it works. Please suggest what's wrong.
I have debug my project and found OnCtlColor calls and it set the text color also.
Please help.
QuestionRe: Set the font for text Pin
«_Superman_»26-Jan-12 18:36
professional«_Superman_»26-Jan-12 18:36 
AnswerRe: Set the font for text Pin
MKC00226-Jan-12 20:41
MKC00226-Jan-12 20:41 
GeneralRe: Set the font for text Pin
«_Superman_»26-Jan-12 20:48
professional«_Superman_»26-Jan-12 20:48 
GeneralRe: Set the font for text Pin
MKC00227-Jan-12 7:45
MKC00227-Jan-12 7:45 
GeneralRe: Set the font for text Pin
MKC00227-Jan-12 8:44
MKC00227-Jan-12 8:44 
QuestionMemory increase in List Control Pin
VCProgrammer26-Jan-12 18:03
VCProgrammer26-Jan-12 18:03 
AnswerRe: Memory increase in List Control Pin
Mohibur Rashid26-Jan-12 19:34
professionalMohibur Rashid26-Jan-12 19:34 
QuestionCString::Find problem Pin
ForNow26-Jan-12 17:19
ForNow26-Jan-12 17:19 
AnswerRe: CString::Find problem Pin
Peter_in_278026-Jan-12 17:59
professionalPeter_in_278026-Jan-12 17:59 
GeneralRe: CString::Find problem Pin
ForNow26-Jan-12 19:26
ForNow26-Jan-12 19:26 
AnswerRe: CString::Find problem Pin
«_Superman_»26-Jan-12 18:56
professional«_Superman_»26-Jan-12 18:56 
QuestionMember to pointer as template argument Pin
LionAM25-Jan-12 10:44
LionAM25-Jan-12 10:44 
AnswerRe: Member to pointer as template argument Pin
Albert Holguin25-Jan-12 13:44
professionalAlbert Holguin25-Jan-12 13:44 
AnswerRe: Member to pointer as template argument Pin
«_Superman_»25-Jan-12 16:52
professional«_Superman_»25-Jan-12 16:52 
GeneralRe: Member to pointer as template argument Pin
LionAM25-Jan-12 23:02
LionAM25-Jan-12 23:02 
GeneralRe: Member to pointer as template argument Pin
«_Superman_»26-Jan-12 3:03
professional«_Superman_»26-Jan-12 3:03 
Questionc++ win32, Trouble getting CreateThread and CreateProcess running together Pin
jkirkerx25-Jan-12 8:13
professionaljkirkerx25-Jan-12 8:13 

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.