CBitmapButton::AutoLoad(UINT nID,CWnd *pParent)用法(特急)

feli1688 2003-04-16 05:16:25
谢谢
...全文
118 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
用户 昵称 2003-04-22
  • 打赏
  • 举报
回复
学习
RocWay007 2003-04-21
  • 打赏
  • 举报
回复
经典
cxjlw 2003-04-18
  • 打赏
  • 举报
回复
谢谢楼主的提问,谢谢高手的指教。
feli1688 2003-04-18
  • 打赏
  • 举报
回复
谢谢你了,我的问题解决了
webber84 2003-04-16
  • 打赏
  • 举报
回复
1.创建一到四个用于在button上显示的位图;
2.在对话框上放一个具有owner-draw属性的button;
3.设置button的caption,比如MYIMAGE,并给它一个ID,如IDC_MYIMAGE;
4.设置刚才创建的位图的ID分别为"MYIMAGEU","MYIMAGED","MYIMAGEF"和"MYIMAGEX"(MYIMAGE是button的caption,其后的U,D,F,X分别表示up,down,focus和disable),注意这些ID必须加引号;
5.在对话框类中增加一个CBitmapButton类成员;
6.在对话框的OnInitDialog函数中调用AutoLoad函数,第一个参数设为button的ID(这里是IDC_IMAGE),第二个参数设为this.
feli1688 2003-04-16
  • 打赏
  • 举报
回复
能否给出其中文说明,谢谢
webber84 2003-04-16
  • 打赏
  • 举报
回复
1:Create one to four bitmap images for the button.


2:Create a dialog template with an owner-draw button positioned where you want the bitmap button. The size of the button in the template does not matter.


3:Set the button’s caption to a value such as “MYIMAGE” and define a symbol for the button such as IDC_MYIMAGE.


4:In your application’s resource script, give each of the images created for the button an ID constructed by appending one of the letters “U,” “D,” “F,” or “X” (for up, down, focused, and disabled) to the string used for the button caption in step 3. For the button caption “MYIMAGE,” for example, the IDs would be “MYIMAGEU,” “MYIMAGED,” “MYIMAGEF,” and “MYIMAGEX.” You must specify the ID of your bitmaps within double quotes. Otherwise the resource editor will assign an integer to the resource and MFC will fail when loading the image.


5:In your application’s dialog class (derived from CDialog), add a CBitmapButton member object.


6:In the CDialog object’s OnInitDialog routine, call the CBitmapButton object’s AutoLoad function, using as parameters the button’s control ID and the CDialog object’s this pointer.

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧