日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CMFCRibbonStatusBar中添加图片按钮

發布時間:2023/12/13 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CMFCRibbonStatusBar中添加图片按钮 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

今天遇到了問題,網上down的

Here's how it works:

1. Create aCMFCRibbonButtonsGroup that will hold the status icon and add it to CMFCRibbonStatusBar

2. Create a CMFCToolBarImagesobject and add status icons via?AddIcon()?.

3. Register theCMFCToolbarImages to the RibbonButtonsGroup using?SetImages()?.For a status Icon, the pHotImages parameter may be set to NULL, since thebutton won't get a message handler assigned anyway. Note however, that both thefirst and the second parameter must be set. If the third is omitted, the iconwill be grayed out for disables buttons and if the first is omitted, no icons willbe displayed at all.

4. Create a new CMFCRibbonButtonand add it to the ButtonsGroup via?AddButton()?.Do *not* assign an Icon to it.

5. Obtain a pointer to thebutton using?CMFCRibbonButtonsGroup::GetButton()?.Then call?CMFCRibbonButton::SetImageIndex()?withthe appropriate index of the icon in the ToolBarImages object.

?

This approach works just fine,except for one minor detail: I was using 16x16 icons as status icons andnoticed that they get cropped on display to 16x15, i.e. the bottom row ofpixels is not displayed. A quick fix for this would be to specify the icon'sdimensions as 16x15 when callingLoadImage()?,but I wonder why this is necessary in the first place. I guess theCMFCRibbonButtonsGroup is to blame for this, though I don't know that classwell enough to claim anything for certain.

Edit:Turns out it really is CMFCToolBarImages's fault. For some reason, the defaulticon size here is 16x15. This can be changed by callingCMFCToolBarImages::SetImageSize() before adding the icons.

轉載于:https://www.cnblogs.com/cyangyang/archive/2010/12/20/1912161.html

總結

以上是生活随笔為你收集整理的CMFCRibbonStatusBar中添加图片按钮的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。