CBitmapButton类的使用
来源:互联网 发布:2015nba总决赛库里数据 编辑:程序博客网 时间:2024/05/02 05:00
CBitmapButton类的使用(收藏)
原文: http://blog.csdn.net/vcleaner/
1、在资源编辑的时候选中按钮的 Owner draw 即可,不需要选择 Bitmap 属性.
2、在程序中定义一个CBitmapButton成员变量。
不能使用ClassWizard为按钮映射一个CButton变量,然后改为CBitmapButton,
这么做并不能将按钮直接映射为CBitmapButton类的对象,反而会出现初始化错误。
3-1、使用CBitmapButton::LoadBitmaps装载各种状态的图片,
使用SubclassDlgItem关联到想要的按钮,
使用CBitmapButton::SizeToContent函数使按钮适合图片大小。
注意Loadbitmaps一定要在关联到按钮之前进行!
3-2、或者是使用CBitmapButton::AutoLoad函数关联到想要的按钮。需要注意:
A、之前不能使用CBitmapButton::LoadBitmaps装载各种状态的图片,否则会出错。
B、AutoLoad函数完成的关联和改变按钮大小的CBitmapButton::SizeToContent函数的功能。
C、CBitmapButton::AutoLoad使用的位图是默认资源ID的,
即它会自动装载相关资源位图。
位图的资源ID格式为:
"按钮Caption+U"、"按钮Caption+D"、"按钮Caption+F"、"按钮Caption+X",
分别代表Up、Down、Focus、Disable状态。
如资源编辑时,希望关联的按钮的Caption为Test,
那么其默认装载的位图资源的ID为:"TestU"/"TestD"/"TestF"/"TestX",
注意分号""也是其ID的一部分。
- CBitmapButton类的使用
- CBitmapButton的使用
- CBitmapButton的使用
- CBitmapButton的使用
- CBitmapButton的使用
- CBitmapButton的使用
- CBitmapButton的使用
- CBitmapButton的使用 (转)
- CBitmapButton的使用
- CBitmapButton的使用
- CBitmapButton的使用
- CBitmapButton的使用
- CBitmapButton的使用
- 使用CBitmapButton类
- MFC CBitmapButton类的应用
- VC 位图按钮CBitmapButton的使用
- VC 位图按钮CBitmapButton的使用
- VC 位图按钮CBitmapButton的使用
- 关于堆栈与队列使用的小思考(1)
- [原创] 如果一个人漏洞百出的话,一定是因为他说得太多了
- VC++实现声音播放
- 在对话框中添加菜单
- 程序不在桌面任务样中显示小图标
- CBitmapButton类的使用
- ACCESS ADP组合框的行来源如何使用参数存储过程?
- 關於SOURCESAFE的一些問題
- ACCESS 如何获取所有菜单栏命令按钮的图片以及FaceID?
- ACCESS 系统菜单中所有菜单项的ID
- ACCESS 如何用 Docmd.OutputTo 将查询导出为 Excel 97-2003 格式?
- [转帖] 关于sizeof()的一些思考
- 將sql橫向數據轉為列向
- ACCESS VBE界面下菜单工具引用(References)和用CreateObject来创建对象的区别