⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_51059.htm

📁 vc
💻 HTM
字号:
<p>
序号:51059 发表者:鹏程 发表日期:2003-08-28 18:17:46
<br>主题:有个问题请教,谢谢了。
<br>内容:&nbsp;&nbsp;&nbsp;&nbsp;我知道在VB中,通过属性窗口可以很方便的设置窗体,控件和文本的颜色。<BR>&nbsp;&nbsp;&nbsp;&nbsp;那么在VC中,怎样改变登录对话框Login的颜色?以及其上的编辑框的颜色?编辑框文本的颜色?静态文本的颜色?请指教,谢谢。<BR><BR><BR><BR>对话框Login的代码如下:<BR>class CLogin : public CDialog<BR>{<BR>// Construction<BR>public:<BR>&nbsp;&nbsp;&nbsp;&nbsp;CLogin(CWnd* pParent = NULL);&nbsp;&nbsp; // standard constructor<BR><BR>// Dialog Data<BR>&nbsp;&nbsp;&nbsp;&nbsp;//{{AFX_DATA(CLogin)<BR>&nbsp;&nbsp;&nbsp;&nbsp;enum { IDD = IDD_LOGIN };<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString&nbsp;&nbsp;&nbsp;&nbsp;m_pass;<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString&nbsp;&nbsp;&nbsp;&nbsp;m_name;<BR>&nbsp;&nbsp;&nbsp;&nbsp;//}}AFX_DATA<BR><BR><BR>// Overrides<BR>&nbsp;&nbsp;&nbsp;&nbsp;// ClassWizard generated virtual function overrides<BR>&nbsp;&nbsp;&nbsp;&nbsp;//{{AFX_VIRTUAL(CLogin)<BR>&nbsp;&nbsp;&nbsp;&nbsp;protected:<BR>&nbsp;&nbsp;&nbsp;&nbsp;virtual void DoDataExchange(CDataExchange* pDX);&nbsp;&nbsp;&nbsp;&nbsp;// DDX/DDV support<BR>&nbsp;&nbsp;&nbsp;&nbsp;//}}AFX_VIRTUAL<BR><BR>// Implementation<BR>protected:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Generated message map functions<BR>&nbsp;&nbsp;&nbsp;&nbsp;//{{AFX_MSG(CLogin)<BR>&nbsp;&nbsp;&nbsp;&nbsp;//}}AFX_MSG<BR>&nbsp;&nbsp;&nbsp;&nbsp;DECLARE_MESSAGE_MAP()<BR>};
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:iamhere 回复日期:2003-08-28 18:24:30
<br>内容:在对话框中处理WM_CTLCOLOR消息,具体看看MSDN的说明吧
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:鹏程 回复日期:2003-08-28 18:38:08
<br>内容:我没有MSDN,另外英文也不懂。“WM_CTLCOLOR消息”在何时被响应?请详解,谢谢。<BR><BR>WM_CTLCOLOR消息的函数如下:朋友可举个例吗?下面的函数怎么用?谢谢了<BR><BR>HBRUSH CLogin::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;// TODO: Change any attributes of the DC here<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;// TODO: Return a different brush if the default is not desired<BR>&nbsp;&nbsp;&nbsp;&nbsp;return hbr;<BR>}<BR><BR>2003-8-28 18:52:44

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -