截獲wm_ctlcolorstatic訊息
gdiplus::bitmap *pbitmap = (gdiplus::bitmap*)cmiuiutils::loadimage(idb_png_license_bg);
if(pbitmap != null)
lresult onctlcolor(uint /*umsg*/, wparam wparam, lparam lparam, bool& bhandled)
::settextcolor(hdc, rgb(0x76, 0x76, 0x76));
::setbkcolor(hdc, rgb(246, 246, 246));
::setbkmode(hdc, transparent);
return (lresult)m_heditbrush/*(hbrush)::getstockobject(null_brush)*/;
}
::sendmessage(m_hedit, wm_setfont, (wparam)cmiuiutils::gettextfont(14, m_hedit), true);
::sendmessage(m_hedit, em_setreadonly, 1l, 0l);
::postmessage(m_hedit, em_setsel, -1, 0);
wtl中的windowproc
begin_msg_map(cmaindlg)
message_handler(wm_initdialog, oninitdialog)
message_handler(wm_destroy, ondestroy)
message_handler(wm_ctlcolorstatic, onctlcolor)
command_id_handler(idok, onok)
command_id_handler(idcancel, oncancel)
end_msg_map()
vc 設定控制項的背景色
過載onctlcolor函式,這個是必須的 設定控制項的背景顏色 第一 afx msg hbrush onctlcolor cdc pdc,cwnd pwnd,uint nctlcolor 在標頭檔案中宣告 在主檔案中 第二 begin message map cok1dlg,cdialog afx...
MFC 控制項背景色
由於需要,要講groupbox控制項和文字控制項static的背景色設為一致。onctrlcolor中設定groupbox背景色 if pwnd getdlgctrlid idc g if pwnd getdlgctrlid idc static1 設定後效果 有個白色背景不符合要求 需要新增此句 ...
部落格設定字型大小 字型顏色 字型風格 背景色。
開始之前正好查了一下關於縮排的設定,如下 半方大的空白用 或 分號為英文符 全方大的空白用 或 不斷行的空白格用 或 csdn的markdown編輯器是其衍生版本,擴充套件了markdown的功能 如 腳注 內嵌html等等 就是內嵌html,接下來要講的功能就需要使用內嵌html的方法來實現。在m...