Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - graying controls
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

graying controls

 Post Reply Post Reply
Author
Message
c_koerber View Drop Down
Newbie
Newbie


Joined: 08 July 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote c_koerber Quote  Post ReplyReply Direct Link To This Post Topic: graying controls
    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 

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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

you must add ON_UPDATE_COMMAND_UI handler:

ON_UPDATE_COMMAND_UI(ID_YOURCOMMAND, OnUpdateYourCommand)

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

 

Back to Top
BruceW View Drop Down
Newbie
Newbie


Joined: 05 April 2006
Location: United Kingdom
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote BruceW Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
BruceW View Drop Down
Newbie
Newbie


Joined: 05 April 2006
Location: United Kingdom
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote BruceW Quote  Post ReplyReply Direct Link To This Post 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.
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.156 seconds.