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的更多相关文章
随机推荐
- order by调优的一些测试
表结构信息:mysql> show create table tb\G*************************** 1. row *************************** ...
- Android中空格及换行
空两个字符 换行 \n
- ylbtech-SubwayNav(地铁线路导航)-数据库设计
ylbtech-DatabaseDesgin:ylbtech-SubwayNav(地铁线路导航)-数据库设计 DatabaseName:SubwayNav(地铁线路导航) Type:线路导航 1.A, ...
- Delphi 让自己的软件实现双击打开文件 转
unit shjAssociateFileType; interface uses Windows, Registry; {将文件类型strFileExtension与程序strExeFileName ...
- android:照片涂画功能实现过程及原理
这个功能可以帮你实现,在图片上进行随意的涂抹,可以用于SNS产品. 绘图本身很简单,但是要实现在图片上指定的部分精确(位置,缩放)的绘图,就有点麻烦了. 下面讲讲实现过程及原理: UI构图 这个UI, ...
- Tkinter教程之Scale篇
本文转载自:http://blog.csdn.net/jcodeer/article/details/1811313 '''Tkinter教程之Scale篇'''#Scale为输出限定范围的数字区间, ...
- Java——泛型(最易懂的方式讲解泛型)
来自: 代码大湿 代码大湿 写在前面: 只要认真看过,基本能很熟悉泛型的特性.泛型是JDK1.5之后出现的,比如JDK1.5之前的ArrayList,会出现2个问题 1:向ArrayList当中添加对 ...
- svn IP地址变更后如何变更
通过grep ip地址,发现svn中url地址信息是记录在.svn文件夹entries文件中的,第一种方案应该是遍历目录下的entries文件,将ip替换为新的ip即可. 可以发现这个用sed命令即可 ...
- thymeleaf的属性优先级
所有Thymeleaf属性定义一个数字优先,建立他们的顺序执行的标签.这个顺序是: Order Feature Attributes 1 Fragment inclusion th:includeth ...
- [iOS 多线程 & 网络 - 1.1] - 多线程NSThread
A.NSThread的基本使用 1.创建和启动线程 一个NSThread对象就代表一条线程创建.启动线程NSThread *thread = [[NSThread alloc] initWithTar ...

