I noticed some applications have a blue circular instead of a checkmark which MF_CHECKED produces. Which style produces this circular one?
Thanks
You normally use the CheckMenuRadioItem function to handle menu radio buttons since it does all the style and checkmark handling for you
Check out the MFT_RADIOCHECK menu type flag...
Related
If this is possible, can you show some code example? Thanks in advance.
ObjectListView is just a nice wrapper around the ListCtrl. To my knowledge, the ListCtrl does not support the embedding of other widgets. You could create a popup dialog when double-clicking a cell and do it that way. Otherwise, you would have to use the UltimateListCtrl. That widget DOES allow widget embedding because it's a custom widget rather than a native one.
I'm having difficulties with an MFC application menu drop down. I want the drop down to display all items when it is clicked. Instead it displays arrows which the user must click in order to show the drop down items.
See the pic below. Any help would be appreciated. Thanks!
I believe this is a feature of the MFC feature pack where the menu will hide rarely used items. You should be able to disable this feature using the CMFCMenuBar::SetShowAllCommands method.
How do you add tooltips for CMenu Items? I couldn't find any straightforward and helpful resource. Please help. Thanks...
The easiest way is to pass multiple strings to the Menu text separated by newline characters.
This will automagically make CMenu display the second part of the text as the menu tooltip.
e.g., If a menu item text is "Click here", change it to
"Click here\nThis is the tooltip for the menu item ..."
Of course, if you like more advanced/fancy tooltips, then try
http://www.tooltips.net/downloads.html
Its easy to implement, and the output is very cool
Tooltips for Menu Item and popup menuitem - CodeProject
http://www.codeproject.com/KB/menus/menuitemtooltip.aspx
Tooltips for Menu Items and Popup Menu Items - CodeGuru
http://www.codeguru.com/cpp/controls/controls/tooltipcontrols/article.php/c5233
I can't vouch for whether this sample works, but the strategy of handling WM_MENUSELECT is sound:
http://msdn.microsoft.com/en-us/magazine/cc164067.aspx
I have a CListCtrl with checkboxes. I want to be able to disable one of the items so that the user cannot click the checkbox. Is this possible? If so, how?
Edit:
Found the specifics on how to hide a checkbox in another question
Need only some rows in a CListCtrl control to have check boxes
Shortly: Not easily possible.
You'll need to sub-class the CListCtrl and implement this behavior on your own or download for example the MFC Grid Control that allows you to do that.
As for the removing check-boxes idea, yes, that might be possible, MSDN:
Version 4.70. Enables check boxes for items in a list-view control. When
set to this style, the control creates
and sets a state image list with two
images using DrawFrameControl. State
image 1 is the unchecked box, and
state image 2 is the checked box.
Setting the state image to zero
removes the check box.
Can anyone explain how to add dropdown arrows to CMFCToolBar toolbar buttons - like for undo/redo buttons. We had this with CToolBar by using the TBSTYLE_EX_DRAWDDARROWS style and TBN_DROPDOWN notification. This doesn't seem to work with CMFCToolBar. These dropdown arrows i believe are added to the VisualStudioDemo MFC feature pack demo but i can not figure out how.
In the VisualStudioDemo sample, in CMainFrame::OnToolbarReset they replace the Undo button of the toolbar with a custom class called CUndoButton, like this:
m_wndToolBar.ReplaceButton(ID_EDIT_UNDO, CUndoButton(ID_EDIT_UNDO, _T("&Undo")));
CUndoButton is declared in file "UndoBar.h" of the sample project, so you can use it or change it however you like.