A design pattern for managing the activation and deactivation of menus and buttons etc in an applica

T

thechaosengine

Hi all,

Does anyone know of a design pattern to deal with the issue of making UI
controls active and inactive according to the context of what the user is
doing?

I've been thinking about the best way to handle this but the only way I can
really think to do it would likely be very messy - trying to deal with it
in event handlers. I can imagine that trying to disable and enable buttons
and menu items and toolbars for a whole host of ui elements for a whole host
of different application contexts could be very messy.

Are there any particular approaches that i should be looking at to manage
the problem a bit better?

Thanks everyone

Simon
 
B

Bob Powell [MVP]

This sort of functionality and the process of undo-redo can be managed using
the Command Pattern.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
G

Guest

Set up a single handler that is called from the various postback events that
cause situtations that enable/disable controls. The basic design pattern is a
command pattern, but you will not likely go full bore on this, as you will
end up moving away from the UI or creating a rather complex page.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

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

Top