V
VickyCool4U
Guest
Hi
I have created a dialog based MFC application in Visual Studio 2010 professional editon and derive a class from CToolBar and used its object in my dialog class:-
CMToolBar:: Create()
{
if(!m_MyToolbar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD |
WS_VISIBLE | CBRS_TOOLTIPS | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_MyToolbar.LoadBitmap(IDB_BITMAP2) ||!m_MyToolbar.SetButtons(ToolsA,sizeof(ToolsA)/sizeof(UINT)))
{
EndDialog(IDCANCEL);
}
// loaded disabled image list
// loaded active image list
GetToolBarCtrl().EnableButton(ID_ONE,false)
}
First Problem:-
CMToolBar::OnClickSecond()
{
GetToolBarCtrl().EnableButton(ID_ONE,true);
GetToolBarCtrl().SetState(ID_SECOND,TBSTATE_PRESSED)
}
So when user called second toolbar button (i.e ID SECOND ), it should enabled the first button which is disabled in create function.
But it is not enabling the first button ?
Second problem:-
When user click second button, it should be in pressed state form, but the (SetState(ID_SECOND,TBSTATE_PRESSED) same is not working also.
Continue reading...
I have created a dialog based MFC application in Visual Studio 2010 professional editon and derive a class from CToolBar and used its object in my dialog class:-
CMToolBar:: Create()
{
if(!m_MyToolbar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD |
WS_VISIBLE | CBRS_TOOLTIPS | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_MyToolbar.LoadBitmap(IDB_BITMAP2) ||!m_MyToolbar.SetButtons(ToolsA,sizeof(ToolsA)/sizeof(UINT)))
{
EndDialog(IDCANCEL);
}
// loaded disabled image list
// loaded active image list
GetToolBarCtrl().EnableButton(ID_ONE,false)
}
First Problem:-
CMToolBar::OnClickSecond()
{
GetToolBarCtrl().EnableButton(ID_ONE,true);
GetToolBarCtrl().SetState(ID_SECOND,TBSTATE_PRESSED)
}
So when user called second toolbar button (i.e ID SECOND ), it should enabled the first button which is disabled in create function.
But it is not enabling the first button ?
Second problem:-
When user click second button, it should be in pressed state form, but the (SetState(ID_SECOND,TBSTATE_PRESSED) same is not working also.
Continue reading...