Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to remove a sub-menu item
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to remove a sub-menu item

 Post Reply Post Reply
Author
Message
thodgson View Drop Down
Groupie
Groupie


Joined: 11 August 2003
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote thodgson Quote  Post ReplyReply Direct Link To This Post Topic: How to remove a sub-menu item
    Posted: 23 May 2005 at 12:24pm

The following code will remove a command that is just below a top level menu, e.g. File -> Open, however if you try and remove one level below that, an ASSERT is thrown.

How do I remove a menu item (control) that is 2 levels down, e.g. File -> Open -> Something?

OnInitCommandsPopup(CXTPCommandBar* pCommandBar)
{
   CXTPControl* pCommandSubItem = pCommandList->FindControl(xtpControlButton, ID_TOOLS_SUBITEM, TRUE, TRUE);
   if (pCommandSubItem)
   {
       pCommandList->Remove(pCommandSubItem);
   }
}



Edited by thodgson
Tim H(http://www.ExclamationSoft.com)
Product: Xtreme Toolkit v13.1
Platform: Vista(x64)-SP1
Language: Visual C++ 6.0
Currently: Satisfied w/ Toolkit
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.