怎样在一个按钮控件上加位图?

beijingboys 2003-10-21 01:10:55
怎样在一个按钮控件上加位图?我用的是CButton类。
...全文
139 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
ggqnetfan 2003-10-21
  • 打赏
  • 举报
回复
http://www.softechsoftware.it/
我试过了,很好用的
arvid_gs 2003-10-21
  • 打赏
  • 举报
回复
下载个第三方控件吧
smallcrocodile 2003-10-21
  • 打赏
  • 举报
回复
下载个第三方控件吧
hardstudylulin 2003-10-21
  • 打赏
  • 举报
回复
如加载位图,用loadBitmap(ID);
将按钮设成:Bitmap、Owner draw

hardstudylulin 2003-10-21
  • 打赏
  • 举报
回复
HICON hIcon;
hIcon=AfxGetApp()->LoadIcon (IDI_SEL_ICON);
m_wndIconButton.SetButtonStyle(WS_CHILD|WS_VISIBLE|BS_ICON);
m_wndIconButton.SetIcon (hIcon);
将按钮设成:Icon、Owner draw
beijingboys 2003-10-21
  • 打赏
  • 举报
回复
我试了还是不可以,我自己有一幅bmp位图想调入,应该怎么实现?
iamknight 2003-10-21
  • 打赏
  • 举报
回复
直接用CBitmapButton
smallsix 2003-10-21
  • 打赏
  • 举报
回复
m_button1.SubclassDlgItem(IDC_OK,this);
m_button1.SetIcon(IDI_OK1,IDI_OK2);
m_button1.SetActiveBgColor(RGB(220,220,220));

即可
SeainBlue 2003-10-21
  • 打赏
  • 举报
回复
CButton::SetBitmap

example:

CButton myButton;

// Create a bitmap button.
myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_BITMAP,
CRect(10,10,60,50), pParentWnd, 1);

// Set the bitmap of the button to be the system check mark bitmap.
myButton.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CHECK)) );

15,979

社区成员

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

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