I trying to disable one of my toolbar-buttons with the following
code:
CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
CToolBar* pToolBar = pMainFrame->GetToolBar();
CToolBarCtrl* pToolBarCtrl = &(pToolBar->GetToolBarCtrl());
pToolBarCtrl->EnableButton(ID_VIEW_SHOWATTRIBUTES, FALSE);
But the button does not get disabled. Anyone know why? I have put these
lines of code into the method OnInitialUpdate of my view.
Thanks,
Ųyvind
pCmd->Enable(1) ..... i don't remember if the method Enable its
correct, but its very similar
I do the same, but with chekbutton as style of buttons of tool bar
> Øyvind
On Thu, 21 Sep 2000 10:34:53 +0200, "Ųyvind Riise"
<oyvind...@telenor.com> wrote:
>Hi,
>
>I trying to disable one of my toolbar-buttons with the following
>code:
>
> CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
> CToolBar* pToolBar = pMainFrame->GetToolBar();
> CToolBarCtrl* pToolBarCtrl = &(pToolBar->GetToolBarCtrl());
> pToolBarCtrl->EnableButton(ID_VIEW_SHOWATTRIBUTES, FALSE);
>
>But the button does not get disabled. Anyone know why? I have put these
>lines of code into the method OnInitialUpdate of my view.
>
>Thanks,
>Ųyvind
>
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm