void CTrail3Dlg::OnEnChangeEdit1()
{
e=(CEdit*)GetDlgItem(IDC_EDIT1);
// TODO: Add your control notification handler code here
}
e is a pointer of type CEDIT.
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);
e->SetFont(&m_font);
}
}</pre>