这是VC++中MFC调用文字对话框改变文本字体,颜色,字号,下划线,删除线的程序,求高手帮我解释,十分感谢
谢谢大侠,帮我解释一下每行的意思及其函数的意思,越详细越好,VC++初学者,求帮助啊。voidCMyView::OnLButtonDown(UINTnFlags,CPoi...
谢谢大侠,帮我解释一下每行的意思及其函数的意思,越详细越好,VC++初学者,求帮助啊。
void CMyView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
LOGFONT lf;
CFont cf;
memset(&lf,0,sizeof(LOGFONT));
CFontDialog dlg(&lf);
CDC *pDC=AfxGetApp()->m_pMainWnd->GetDC();
if(dlg.DoModal()==IDOK){
dlg.GetCurrentFont(&lf);
pDC->SetTextColor(dlg.GetColor());
cf.CreateFontIndirect(&lf);
CFont *def_font=pDC->SelectObject(&cf);
pDC->TextOut(point.x,point.y,"钓鱼岛是中国的");
pDC->SelectObject(def_font);
cf.DeleteObject();
} 展开
void CMyView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
LOGFONT lf;
CFont cf;
memset(&lf,0,sizeof(LOGFONT));
CFontDialog dlg(&lf);
CDC *pDC=AfxGetApp()->m_pMainWnd->GetDC();
if(dlg.DoModal()==IDOK){
dlg.GetCurrentFont(&lf);
pDC->SetTextColor(dlg.GetColor());
cf.CreateFontIndirect(&lf);
CFont *def_font=pDC->SelectObject(&cf);
pDC->TextOut(point.x,point.y,"钓鱼岛是中国的");
pDC->SelectObject(def_font);
cf.DeleteObject();
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询