Print Page | Close Window

graying controls

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=93
Printed Date: 28 April 2024 at 10:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: graying controls
Posted By: c_koerber
Subject: graying controls
Date Posted: 08 July 2003 at 6:56am

I want to disable some controls and want their respective icons to become grey and unpressable, i.e. not responsive.

Neither SetVisible(FALSE) nor SetEnabled(FALSE) seem to do anything at all.

Any suggestions?

BTW, is their any documentation beside the sample code and the help files?

regards, Christian 

 




Replies:
Posted By: Oleg
Date Posted: 09 July 2003 at 12:26pm

According to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_how_to_update_user.2d.interface_objects.asp - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_how_to_update_user.2d.interface_objects.asp

you must add ON_UPDATE_COMMAND_UI handler:

ON_UPDATE_COMMAND_UI(ID_YOURCOMMAND, OnUpdateYourCommand)

void CMainFrame::OnUpdateYourCommand(CCmdUI* pCmdUI)
{
 pCmdUI->Enable(FALSE);
}

 



Posted By: BruceW
Date Posted: 10 April 2006 at 5:05am
Hi,

I have the same problem.  I would like to remove an item from a menu (though not delete it), and so have tried using SetVisible( FALSE ).  However it appears to have no effect.

I cannot use a command handler as I need to do this before the menu is shown, and also my menus are dynamic depending on the user selction, thus do not have fixed Ids.

Thanks,

Bruce.


Posted By: BruceW
Date Posted: 10 April 2006 at 5:49am
Hi,

I have overcome this particular problem, so it is no longer an issue for me.

Ta,

Bruce.



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