![]() |
How to make some icon of toolbar grayed |
Post Reply ![]() |
Author | |
yanlv ![]() Groupie ![]() Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() Posted: 24 July 2008 at 5:38am |
There's an icon on my toolbar. I hope it is grayed from the beginning, but will become bright when I send a command. How to make this icon grayed in the function oncreate() or oncreatecontrol().
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
you need add Update handler for Id and enable/disable your command.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
barobax ![]() Senior Member ![]() Joined: 07 May 2008 Status: Offline Points: 117 |
![]() ![]() ![]() ![]() ![]() |
Hi,
what about MiniToolbar ?! My buttons are disabled. |
|
(Farsi IS WRONG you must say [PARSI])
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Did you add update handlers? See how it works with our sample.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
yanlv ![]() Groupie ![]() Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() |
sorry, I didn't add updated handlers, but I'll test it. Could you answer me another problem about cutomize which is in another topic? Thanks.
|
|
![]() |
|
yanlv ![]() Groupie ![]() Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() |
*****************
To oleg: I test your idea and it works. In details: add the code in updated handler CMainFrame* mainwnd=(CMainFrame *)AfxGetMainWnd(); CXTPControlAction* pMenuItem = mainwnd->GetpAction(pCmdUI->m_nID); if(flag != 0) { pMenuItem->SetEnabled(TRUE); } else { pMenuItem->SetEnabled(FALSE); } ****** to barobax: I didn't test your idea. Maybe later when I'm free. |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
All above lines can be replaced to
pCmdUI->Enable(flag);
:)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
yanlv ![]() Groupie ![]() Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() |
thanks. I'm only a new guy to GUI.
|
|
![]() |
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 |