Equivalent to OnUpdateCmdUI? (how to update menus/toolbars in .NET?)

  • Thread starter Thread starter Scott Smith
  • Start date Start date
S

Scott Smith

I'm working on the first non-trivial application written in C#/.NET, and I'm
having to implement a lot of the framework that was provided in MFC.

In particular, menu items and toolbar buttons would
enable/disable/check/whatever automatically, as long as you handled the
OnUpdateCmdUI message properly.

I'm trying to figure out how to update the state of menu items and toolbar
buttons (etc.) when items are selected in various controls inside various
views (sub-form windows). Obviously I don't want to do hack-ish things like:
Parent.Parent._menuItemX.Enabled = false

I've looked around on http://www.codeproject.com/, but haven't found
anything specifically addressing this issue. Is there a generally-accepted
"best practice" for doing this without wiring all of your classes together?

Thanks in advance.

-Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top