CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 1999
    Location
    France
    Posts
    393

    ToolStripMenuItem enable/disable

    Hi,
    I'm new in C-Sharp so sorry "easy" for this question.

    I come from Win32/MFC world.

    I MFC to enable/disable menu item at Runtime I got to make an handler for the UpdateCommandUI and in it enable or disable the item.

    Is there a way to do it the same way in CSharp or do I have to enable/disable item each time a menu will be shown?


    Thanks

  2. #2
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

  3. #3
    Join Date
    Sep 1999
    Location
    France
    Posts
    393

    Re: ToolStripMenuItem enable/disable

    Hi,

    Thanks for the answer,

    But it is not what I intend to ask in fact.
    I know that .Enabled will do the stuff, but What I'm looking for is the same UpdateCommandUI process in C#.

    I mean that the framework come and ask the state of the menuitems when needed and that I don't have to explicitly set the status of items each time I display a menu.

    Thanks

  4. #4
    Join Date
    Nov 1999
    Location
    Denmark
    Posts
    260

    Re: ToolStripMenuItem enable/disable

    when the menu is created
    and you set enable and disable on it and or on it's items
    they will have that state untill you dispose of the object

    you dont have to redo properties when ever the menu is being displayed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured