![]() |
Button not getting dissabled |
Post Reply
|
| Author | |
vijaymahajan
Groupie
Joined: 16 June 2008 Status: Offline Points: 92 |
Post Options
Thanks(0)
Quote Reply
Topic: Button not getting dissabledPosted: 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.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |