Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to make some icon of toolbar grayed
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to make some icon of toolbar grayed

 Post Reply Post Reply
Author
Message
yanlv View Drop Down
Groupie
Groupie


Joined: 23 June 2008
Location: China
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote yanlv Quote  Post ReplyReply Direct Link To This Post Topic: How to make some icon of toolbar grayed
    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().
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2008 at 7:37am
Hi,
you need add Update handler for Id and enable/disable your command.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
barobax View Drop Down
Senior Member
Senior Member


Joined: 07 May 2008
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote barobax Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2008 at 3:19pm
Hi,
what about MiniToolbar ?! My buttons are disabled.
(Farsi IS WRONG you must say [PARSI])
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2008 at 1:46am

Hi,

Did you add update handlers? See how it works with our sample.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
yanlv View Drop Down
Groupie
Groupie


Joined: 23 June 2008
Location: China
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote yanlv Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2008 at 2:55am
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.
Back to Top
yanlv View Drop Down
Groupie
Groupie


Joined: 23 June 2008
Location: China
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote yanlv Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2008 at 2:58am
*****************
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.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2008 at 4:14am
All above lines can be replaced to
 
pCmdUI->Enable(flag);
 
:)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
yanlv View Drop Down
Groupie
Groupie


Joined: 23 June 2008
Location: China
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote yanlv Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2008 at 9:43pm
thanks. I'm only a new guy to GUI.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.