toolbar button conrol not enabled

  • Thread starter Thread starter VickyCool4U
  • Start date Start date
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...
 

Similar threads

V
Replies
0
Views
108
VickyCool4U
V
V
Replies
0
Views
137
VickyCool4U
V
Z
Replies
0
Views
107
Zebedee6
Z
Back
Top