Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Button not getting dissabled
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Button not getting dissabled

 Post Reply Post Reply
Author
Message
vijaymahajan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 June 2008
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote vijaymahajan Quote  Post ReplyReply Direct Link To This Post Topic: Button not getting dissabled
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.157 seconds.