C++ BackColor_Dialog
相关主题 |
1. 2. |
对话框背景色 |
其他相关
|
代码::用纯色 |
HBRUSH
CProject01Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) {
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any
attributes of the DC here CBrush cbrush(RGB(255,0,0));
CRect crect;
GetClientRect(crect);
pDC->SelectObject(&cbrush);
pDC->FillRect(crect,&cbrush);
return cbrush;
// TODO: Return a different
brush if the default is not desired return hbr;
} 效果图 有个现象当单击1个按钮时 |
代码::用位图 |
resources 导入1个bitmap位图
// mfcDlg.h : header file
// Implementation
protected:
HICON m_hIcon;
CBrush m_BKBrush;//画刷 ::OnInitDialog()
// TODO: Add extra initialization here
CBitmap* pBitmap = new CBitmap;
ASSERT(pBitmap);
pBitmap->LoadBitmap(IDB_BITMAP1);//载入位图资源
m_BKBrush.CreatePatternBrush(pBitmap);//创建位图画刷
delete pBitmap;
::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
// TODO: Change any attributes of the DC here
if (nCtlColor == CTLCOLOR_DLG )
return (HBRUSH)m_BKBrush.GetSafeHandle(); //返回创建的位图画刷
// TODO: Return a different brush if the default is not desired
效果图 |
Shape
C++ BackColor_Dialog的更多相关文章
随机推荐
- MySQL压测中遇到的一些问题
批量insert http://blog.csdn.net/xiaoxian8023/article/details/20155429 Mysql jdbc 批处理数据,需要给jdbc连接加上rewr ...
- Android入门:用HttpClient模拟HTTP的GET和POST请求
一.HttpClient介绍 HttpClient是用来模拟HTTP请求的,其实实质就是把HTTP请求模拟后发给Web服务器: Android已经集成了HttpClient,因此可以直接使用: ...
- redis 和 bloom filter
今天打算使用redis 的bitset搞一个 bloom filter, 这样的好处是可以节省内存,坏处是可能在会有一些数据因为提示重复而无法保存. bloom filter 的大体原理就是通过不同的 ...
- VS2010生成Qt程序图标修改方法
转自:http://blog.csdn.net/simeone18/article/details/7344547 1.准备ico文件,nuistcard.ico 2.在nuistcard工程目录,建 ...
- 【转】发布python的包至pypi服务器
[原文链接]http://yejinxin.github.io/distribute-python-packages-to-pypi-server/ 使用pip或easy_install可以管理和安装 ...
- uC/OS - III 移植 IAR平台
关于移植uC/OS-III 网上已经有很多教程了此处只是做个记录 首先下载源码然后解压得到下面的文件: 然后在模版工程里新建各种文件夹: 最后全部都添加进工程: OK了,编译一下,惊呆了,竟然 0错误 ...
- wuzhicms 后台登录存留时间实现方式
在五指后台管理登录后,超过半小时不操作后台(不刷新页面或切换页面),就就会强制退出后台. 实现的思路是,在每次刷新页面都把当前时间存储下来,利用php的session机制来检测比对当前时间和数据库中存 ...
- CentOS VPS创建pptpd VPN服务
原文地址http://www.hi-vps.com/wiki/doku.php?id=xen_vps_centos6_install_pptpd CentOS VPS创建pptpd VPN服务 Xen ...
- Hadoop port to Jxta P2P Framework
https://www.java.net/forum/topic/jxta/jxta-community-forum/hadoop-port-jxta-p2p-framework —————————— ...
- POJ 3026 Borg Maze(bfs+最小生成树)
Borg Maze Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6634 Accepted: 2240 Descrip ...