Print Page | Close Window

How to make some icon of toolbar grayed

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=11561
Printed Date: 15 September 2025 at 1:26am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to make some icon of toolbar grayed
Posted By: yanlv
Subject: How to make some icon of toolbar grayed
Date 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().



Replies:
Posted By: Oleg
Date 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


Posted By: barobax
Date Posted: 30 July 2008 at 3:19pm
Hi,
what about MiniToolbar ?! My buttons are disabled.


-------------
(Farsi IS WRONG you must say [PARSI])


Posted By: Oleg
Date 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


Posted By: yanlv
Date 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.


Posted By: yanlv
Date 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 member_profile.asp?PF=4159&FID=112 - barobax : I didn't test your idea. Maybe later when I'm free.


Posted By: Oleg
Date Posted: 03 August 2008 at 4:14am
All above lines can be replaced to
 
pCmdUI->Enable(flag);
 
:)


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: yanlv
Date Posted: 04 August 2008 at 9:43pm
thanks. I'm only a new guy to GUI.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net