Solved

MFC get rid of annoying chevron

Posted on 2013-11-20
5
378 Views
Last Modified: 2013-11-20
MFC C++ MSVS2010

How do I disable chevron in menu?
0
Comment
Question by:supportoranges
  • 3
  • 2
5 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 39662753
Hi supportoranges,

could you please be a bit more elaborate what you mean with chevron in menu.

What kind of application do you use (Dialog, SDI, MDI)?
Do you use 'new' MFC base classes like i.e. CWinAppEx, CDialogEx, CMDIFrameWndEx?
What kind of menu do you mean (i.e. main window menu bar or popup menu)?
Could you post a screenshot?

ZOPPO
0
 
LVL 1

Author Comment

by:supportoranges
ID: 39663000
Chevron is the little arrow thingy (pls see it in the attachment).   This is an MDI doc.   I use CWinAppEx.  This is a popup menu.  Hope this helps...
chevron.png
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 500 total points
ID: 39663073
Hi supportoranges,

ok, this 'chevron' indicates not all menu items are shown, only the most-recently used items are shown initially, clicking on it will show the rest.

This is a optional feature which can be turned on/off in the 'Options' tab of the customize window in the app.

If you don't want to allow the user to choose this option at all you can remove some code near the end of your CMainFrame::OnCreate which (per default) looks somehow like this:
	// enable menu personalization (most-recently used commands)
	// TODO: define your own basic commands, ensuring that each pulldown menu has at least one basic command.
	CList<UINT, UINT> lstBasicCommands;

	lstBasicCommands.AddTail(ID_FILE_NEW);
	lstBasicCommands.AddTail(ID_FILE_OPEN);
	... // more similar lines.
	lstBasicCommands.AddTail(ID_SORTING_SORTBYACCESS);
	lstBasicCommands.AddTail(ID_SORTING_GROUPBYTYPE);

	CMFCToolBar::SetBasicCommands(lstBasicCommands);

Open in new window

This will remove this optional feature completeley so the user can't re-activate it anymore.

If instead you only want to turn of the behavior initially (so when the application runs the first time) you can simply add this line even near the end of CMainFrame::OnCreate:
	m_wndMenuBar.SetRecentlyUsedMenus( FALSE );

Open in new window

Thus you don't remove the feature but initially disable it, so the user later can decide to turn it on if he wants it.

Hope that helps,

ZOPPO
0
 
LVL 1

Author Closing Comment

by:supportoranges
ID: 39663106
Thank you so much, you saved me a ton of time!
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 39663116
:o)

You're welcome - I'm glad I could help ...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question