Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Removing sub-menus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Removing sub-menus

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


Joined: 12 May 2003
Location: United Kingdom
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Graham Quote  Post ReplyReply Direct Link To This Post Topic: Removing sub-menus
    Posted: 01 July 2004 at 5:04am

Hi,

Does anybody know how to dynamically remove entire sub-menus. I can remove the sub menu items OK, but the parent pop-up menu remains.

Thanks,

Graham

Back to Top
softz View Drop Down
Newbie
Newbie
Avatar

Joined: 29 December 2003
Location: Singapore
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote softz Quote  Post ReplyReply Direct Link To This Post Posted: 22 July 2004 at 1:05am

You may try this perhaps

// This is where your menu loaded
CXTMenu menu;
menu.LoadMenu(IDR_MENU);

// Go to the next level of submenu
CXTMenu* pSubMenu = menu.GetSubMenu(0);
for(UINT i = 0; i < pSubMenu->GetMenuItemCount(); i++)
{

     pSubMenu->RemoveMenu(i, MF_BYPOSITION);
}

Regards.

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.172 seconds.