void CNoteTestDlg::OnEditFont()
{
//TODO: 在此添加命令處理程式代碼
CFont* TempFont = m_FileText.GetFont();
LOGFONT LogFont;
COLORREF clr;
TempFont->GetLogFont(&LogFont);
clr = RGB(0, 0, 0);
CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
m_Font.Detach();
dlg.GetCurrentFont(&LogFont);
COLORREF m_clr = dlg.GetColor();
m_Font.CreateFontIndirect(&LogFont);
m_FileText.SetFont(&m_Font);
clr = dlg.GetColor();
}
}
頭檔案中還有一個定義 CFont m_Font;
能修改字體不能修改顏色,還需要做什么嗎?
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/238770.html
標籤:基礎類
上一篇:求影像邊緣提取示例代碼
