为Edit控件添加指定位图背景
2011-03-31 14:09
253 查看
BOOL CMyEdit::OnEraseBkgnd(CDC* pDC) { // TODO: Add your message handler code here and/or call default //************************************************************************************** //取消文字复选 this->SetSel(0,0); //设置位图背景 CBitmap bitmap; bitmap.LoadBitmap(IDB_BITMAP1); BITMAP bmp; bitmap.GetBitmap(&bmp); CDC dcCompatible; dcCompatible.CreateCompatibleDC(pDC); dcCompatible.SelectObject(&bitmap); CRect rect; GetClientRect(&rect); pDC->BitBlt(0,0,rect.Width(),rect.Height(),&dcCompatible,0,0,SRCCOPY); return TRUE; //********************************************************************************* //CEdit::OnEraseBkgnd(pDC); }
相关文章推荐
- 关于对话框界面控件处理之——为控件添加背景位图
- MFC将一个位图添加到数据库中并且将其读出来到指定的Picture控件上
- VC++ 为列表框控件添加位图背景
- MFC/VC++中怎样将一个位图添加到数据库中并且将其读出来到指定的Picture控件上
- CreateDIBitmap的用法和StretchDIBits用法举例,来显示位图到指定的picture控件中
- mfc对话框程序如何添加背景图片以及使控件背景图片与对话框一致
- MFC对话框修改背景颜色或添加背景图片、控件背景与字体颜色的修改
- 设置只读Edit控件背景白色
- VC中实现带有背景位图的树型控件
- mfc edit控件只读属性与背景颜色问题小发现
- 为EditText指定背景
- Android开发中给EditText控件添加TextWatcher监听实现对输入字数的限制
- VC的对话框编辑器怎么为Edit控件指定一个快捷键
- 具有背景颜色和文字颜色的只读属性的EDIT控件的实现
- 给控件添加背景透明
- 只将unity的UI控件添加到iOS视图层,不显示unity的原生背景(二)
- MFC在对话框中添加背景图片导入位图出错的解决方法
- mfc导入位图到指定地方,背景导入新方法
- 为MFC控件ListCtrl添加背景图
- Winform 后台将指定的控件集合添加到制定容器中