|
-
April 2nd, 2004, 11:12 PM
#1
How to get rid of the toolbar's auto disable fuction
I've created a toolbar in one of my views and handled the message in the view. All works fine. But when that view is inactived, the buttons on the toolbar is auto disenabled. It looks urgly. If I handle the message in main frame it is enabled all the time. But I really want to handle the message in that view. How can I get rid of the MFC fuction.
-
April 3rd, 2004, 01:13 AM
#2
Just move the button's OnUpdateCmdUI() to the main frame,
and leave the message handler in the view (i.e OnMyBtnClick() )
hth
-
April 3rd, 2004, 04:56 AM
#3
I don't know how to move the OnUpdateCmdUI to MainFrame, the toolbar is a view's variable. But I've resolved the problem by you guide. Just override the OnUpdateCmdUI fuction.
void CTrueColorToolBar::OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler)
{
CToolBar::OnUpdateCmdUI(pTarget, FALSE);
}
Thanks a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|