Print Page | Close Window

Button not getting dissabled

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=11281
Printed Date: 03 October 2024 at 12:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Button not getting dissabled
Posted By: vijaymahajan
Subject: Button not getting dissabled
Date Posted: 02 July 2008 at 6:30am
hello,
I have created one CXTPControlButton in ribbon bar by using this code.

pSaveSelButton = pGroupEnhancementMode->AddxtpControlButton,ID_BTN_SAVESELECTION);pSaveSelButton->SetStyle(xtpButtonIcon);pSaveSelButton->SetWidth(40);pSaveSelButton->SetHeight(60);pSaveSelButton->SetTooltip(_T("Save Selection"));pSaveSelButton->SetEnabled(FALSE);

Then i wrote the empty ON_UPDATE_COMMAND_UI event handler. that time it was appearing dissabled.it was like this - void CMainFrame::OnUpdateBtnSelectionShowHide(CCmdUI* pCmdUI){};

But when i write ON_BN_CLICKED event handler for this button,it doesnt remain dissabled initially.i want that button to be dissabled initially,but afterwords i want it enable,when i will say SetEnable(true).
How can i do that,please let me know.Please explain in detail.
 
Thanks And Regards,
Vijay.



Replies:
Posted By: Oleg
Date Posted: 02 July 2008 at 9:42am
Add some variable m_bSaveEnabled and code
 
CMainFrame::OnUpdateBtnSelectionShowHide(CCmdUI* pCmdUI)
{
  pCmdUI->SetEnabled(m_bSaveEndbled);
};
 
now you can change variable m_bSaveEnabled to Enable/Disable tis button.


-------------
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