Questions tagged [cmfctoolbar]

CMFCToolBar is a MFC class to handle toolbars

The CMFCToolBar class resembles CToolBar class, but provides additional support for user interface features. These include flat toolbars, toolbars with hot images, large icons, pager buttons, locked toolbars, rebar controls, text under images, background images, and tabbed toolbars. The CMFCToolBar class also contains built-in support for user customization of toolbars and menus, drag-and-drop between toolbars and menus, combo box buttons, edit box buttons, color pickers, and roll-up buttons.

Official documentation

41 questions
6
votes
1 answer

CMFCToolbar ReplaceButton() causes button to disappear

Using Visual Studio 2010 and working with an MFC SDI Application. I have a CMFCToolbar object owned by the Main Frame. When the document in this application is created, the MainFrame calls a function to replace one of the buttons in the…
smgorden
  • 61
  • 5
3
votes
1 answer

MFC: How to set the focus of CEdit boxes?

I'm working on my first simple MFC project, but I'm struggling with one problem: want to set the focus of all CEdit boxes in one of the dialogs. My idea is when open the dialog, the focus to be on the first edit box and then to swap between them…
3
votes
1 answer

How to set alpha value for all pixels in a bitmap using MFC or GDI or GDI+

I am in an MFC application. I created a bitmap using a memory DC I want to save it to DIB file. I found this code to be most elegant so far: void Save(CBitmap * bitmap) { CImage image; image.Attach((HBITMAP)pcBitmap->GetSafeHandle()); …
2
votes
0 answers

Grey Image in CMFCToolBar Menu

I want to achieve the Menu style same like Visual Studio with Images (see image below) I could insert items in Menu using CMFCToolBarMenuButton. But the problem is with Disable state. My Menu images are completely greyed out (see image below) I…
latosvarun
  • 93
  • 6
2
votes
1 answer

MFC: What method is used to set the toolbar buttons to be a subset of the total toolbar buttons by default?

I want to add all menu items to the toolbar but only have a subset of them showing by default (without user having to customize). This way all menu items will have icons next to them, but the toolbar won't contain the seldom used items unless users…
user3161924
  • 1,849
  • 18
  • 33
2
votes
2 answers

How to change CMFCToolBar runtime

I need under certain conditions to switch toolbars in my SDI application using the same CMFCToolBar object, which is the member of CMainFrame. I'm trying to do it like this: void CMainFrame::ChangeTlbr(const int tlbIdx) { …
goodking
  • 145
  • 1
  • 12
2
votes
1 answer

Adding a drop-down menu button to a CMFCToolbar, not seeing menu

I tried following all the examples I could find but I'm missing something so I will put all the pieces here for others to view. FYI - I'm modifying the MFC Feature Pack example Slider. I see the layer button (not a string or down arrow) if I select…
Tony Teveris
  • 165
  • 10
2
votes
0 answers

Scale CMFCToolbar for DPI changes

I have several large toolbars in an MFC application for Window 8.1. Right now I am using the following code to replace the image of each button using current DPI scaling when the application is moved to a monitor with different DPI settings. const…
Liton
  • 1,398
  • 2
  • 14
  • 27
2
votes
1 answer

CMFCToolBar & CMFCMenuBar don't show dynamic items by default

I created a MFC application that uses CMFCToolBar and CMFCMenuBar. It saves it's first time items state, when I change or add any dynamic items I still see the first state the deleted items stay there the added items are not shown, then I found that…
ahmedsafan86
  • 1,776
  • 1
  • 26
  • 49
1
vote
1 answer

CMFCToolbar treat toolbar buttons as a group (Check/Uncheck)

I have three buttons in a CMFCToolbar that is contained in a CDialogEx, that I have set their styles to TBBS_CHECKGROUP This allows each button to be toggled from checked to unchecked states, however I'd like to treat these three buttons as a group…
user20716902
  • 861
  • 1
  • 14
1
vote
1 answer

MFC: CMFCMenuBar.SetMenuFont() not changing the font?

Changed an MFC app to per-monitor DPI aware. On the WM_DPICHANGED message I wanted to changed the fonts of the CMFCMenuBar to be scaled correctly. So I added: LOGFONT logfont; GetGlobalData()->fontRegular.GetLogFont(&logfont); …
df234987
  • 513
  • 2
  • 13
1
vote
1 answer

MFC: How do you get CMFCToolBarComboBoxButton to show on a CMFCToolBar?

Something I thought would be easy I can't get to work. How do I get a ComboBox to show on the CMFCToolBar? Here's what I have done that doesn't work (meaning it just shows the original placeholder button with the circle (grayed out)). 1 - I added…
df234987
  • 513
  • 2
  • 13
1
vote
1 answer

How to set size and Transparent / Clear CMFCToolBar Button and Icon in mfc?

I have created some (CMFCToolBar) toolbars and added buttons and icons to them. I read on Microsoft's official website that CMFCToolBar takes 23x22 button size and 16x15 icon size (ref: link). If I use 16x15 for the icons, then icons appear blurry.…
Fatima A.
  • 41
  • 13
1
vote
0 answers

Toolbar shows no icons

I have been trying to put a CMFCMenuBar and CMFCToolBar together. The OnCreate of CFrameWndEx has following code for the purpose if ( !m_wndMenuBar.Create(this) ) { TRACE0("Failed to create menubar\n"); return -1; // fail to…
Muhammad Tauseef
  • 413
  • 2
  • 6
  • 18
1
vote
1 answer

How to support accessibility in CMFCMenuBar and its items

I need to enable accessibility for the CMFCMenubar to use it in the coded ui test (not supported by default) as mentioned in this post on MSDN Visual Studio blog that MFC feature pack controls (like CMFCMenuBar) are not fully supported. I used a…
ahmedsafan86
  • 1,776
  • 1
  • 26
  • 49
1
2 3