Print Page | Close Window

Enable-Disable Menu

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7863
Printed Date: 19 July 2025 at 10:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Enable-Disable Menu
Posted By: KumarCJ
Subject: Enable-Disable Menu
Date Posted: 23 August 2007 at 8:33am

Hi,

In the FILE menu, under FILE menu we have Open, Save, Export (Export contain Export DB and Export Text submenu).

File menu looks like below:

File
  Open
  Save
  Export > Export DB    (ID_EXP_DB)
                 Export Text  (IDM_EXP_TEXT)

  Print
  Exit

How can I disable the "Export DB" which is submenu of "Export" menu, based on certain condition.

I tried with below given code. Please suggest.
 
For rest of the menu items I am enabling and diabling using below code.

CXTPPopupBar* pCommandBar;

int nCount = pCommandBar->GetControls()->GetCount();
int i = 0;
for (i = 0; i < nCount; i++)
{
CXTPControl* pCommandBarNew =  pCommandBar->GetControl(i);
 
if (pCommandBarNew->GetID() == ID_FILE_PRINT) //Print
{
 if(var == NULL)
{
 pCommandBarNew->SetEnabled(FALSE);
 pCommandBarNew->SetFlags(xtpFlagManualUpdate);
}
else
{
 pCommandBarNew->SetEnabled(TRUE);
 pCommandBarNew->SetFlags(xtpFlagManualUpdate);
}
}
}




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