In my project I've 8 edit boxes and i need to set each box with different font. But my code is setting all the boxes single font.. So how can i modify it??
void CTrail3Dlg::OnBnClickedButton1()
{
UpdateData(TRUE);
CFontDialog dlg;
// get font for current dialog, just to fill in LOGFONT
LOGFONT lf;
CFont *pFont = GetFont();
pFont->GetLogFont(&lf);
if (dlg.DoModal()== IDOK)
{
dlg.GetCurrentFont(&lf);
m_font.DeleteObject();
m_font.CreateFontIndirect(&lf);
GetDlgItem(IDC_EDIT1)->SetFont(&m_font);
GetDlgItem(IDC_EDIT2)->SetFont(&m_font);
GetDlgItem(IDC_EDIT3)->SetFont(&m_font);
GetDlgItem(IDC_EDIT4)->SetFont(&m_font);
GetDlgItem(IDC_EDIT5)->SetFont(&m_font);
GetDlgItem(IDC_EDIT6)->SetFont(&m_font);
GetDlgItem(IDC_EDIT7)->SetFont(&m_font);
GetDlgItem(IDC_EDIT8)->SetFont(&m_font);
}
// TODO: Add your control notification handler code here
}