Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott Smith - 15 Apr 2005 23:09 GMT
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
Joel Matthias - 16 Apr 2005 20:04 GMT
Hi,

Take a look at this MSDN article. I have used it in my Windows Forms
application and it works pretty well.

http://msdn.microsoft.com/msdnmag/issues/02/10/CommandManagement/

Joel

> 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.
[quoted text clipped - 16 lines]
>
> -Scott
Scott Smith - 17 Apr 2005 21:47 GMT
(snip)

> Hi,
>
[quoted text clipped - 4 lines]
>
> Joel

Perfect! That's exactly what I needed. Thanks!

-Scott

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.