Print Page | Close Window

Remove menu .

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=632
Printed Date: 15 May 2024 at 8:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Remove menu .
Posted By: Asha Udupa
Subject: Remove menu .
Date Posted: 19 April 2004 at 6:10am

Hi

I am using the following code to remove a menu item.

 CXTPControls* pControlView  = (CXTPControls*)(GetCommandBars()->GetMenuBar())->GetCo ntrols();
  CXTPControl* pCommandNew = pControlView->FindControl(xtpControlButton, ID_DELITEM, TRUE,TRUE);
  if (pCommandNew)
  {
   pControlView->Remove(pCommandNew);
     }

After this if I try to open the same menu application crashes.

Could any one please tell is this the right wa of deleting a menu item?

Regards

Asha

 




Replies:
Posted By: Oleg
Date Posted: 19 April 2004 at 10:47am

 CXTPControl* pCommandNew =

GetCommandBars()->GetMenuBar()->GetControls->FindCo ntrol(xtpControlButton, ID_DELITEM, TRUE,TRUE);


if (pCommandNew)
{
               pCommandNew->GetControls()->Remove(pCommandNew);
}



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net