永发信息网

mfc如何更改单文档工具栏图标

答案:2  悬赏:40  手机版
解决时间 2021-03-02 01:49
  • 提问者网友:我没有何以琛的痴心不悔
  • 2021-03-01 14:25
mfc如何更改单文档工具栏图标
最佳答案
  • 五星知识达人网友:渡鹤影
  • 2021-03-01 16:03
需要自己绘制同样规格的bmp工具条,然后导入该工具条,修改ID即可
全部回答
  • 1楼网友:由着我着迷
  • 2021-03-01 17:42
visual c++ provides you with two methods to create a toolbar. to create a toolbar resource using the resource editor, follow these steps: //在资源编辑器中创建一个toolbar资源 create a toolbar resource.//常见一个toolbar资源 construct the ctoolbar object.//构造一个toolbar对象 call the create (or createex) function to create the windows toolbar and attach it to the ctoolbar object.//调用creat或者createx函数创建窗口toolbar并且将其与toolbar对象关联 call loadtoolbar to load the toolbar resource.//调用 loadtoolbar载入toolbar资源 otherwise, follow these steps: construct the ctoolbar object.//构造ctoolbar对象 call the create (or createex) function to create the windows toolbar and attach it to the ctoolbar object.//调用create (or createex)函数创建窗口toolbar并关联到ctoolbar 对象 call loadbitmap to load the bitmap that contains the toolbar button images.//调用loadbitmap 载入包含了toolbar按钮图片的bitmap*****************载入图标操作,图标可以通过资源管理器导入。 call setbuttons to set the button style and associate each button with an image in the bitmap.//调用setbuttons 设置按钮类型并且将每一个按钮和图片关联 all the button images in the toolbar are taken from one bitmap, which must contain one image for each button. all images must be the same size; the default is 16 pixels wide and 15 pixels high. images must be side by side in the bitmap.//所有的工具栏按钮图片都来自于一个位图,且每一个按钮必须包含一个位图。所有的图片必须有相同的大小,默认时16像素宽,15像素高。图片必须边挨边在为图中。 上面是msdn中的说明,很清楚的说明了如何向工具栏中添加图标。 1、在资源管理器中添加一个工具栏资源 2、定义一个工具栏对象并且和工具栏资源关联 3、用loadbitmap函数将图标载入到工具栏,loadbitmap 函数的使用可以查阅msdn 4、用setbuttons 将按钮和图片关联起来就行了
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯