473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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

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

Jul 21 '05 #1
2 1963
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.

"thechaosengine" <na> wrote in message
news:21*********************@news.microsoft.com...
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

Jul 21 '05 #2
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!
***************************

"thechaosengine" wrote:
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

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Torsten Wiebesiek | last post by:
Hi, I am currently working on a computer vision system. At the moment I'm adding support for firewire cameras. Since there is only one firewire system on a computer, I have writen a firewire...
10
by: Saso Zagoranski | last post by:
hi, this is not actually a C# problem but since this is the only newsgroup I follow I decided to post my question here (please tell me where to post this next time if you think this post...
2
by: Matthew Hood | last post by:
My company has expressed a desire to convert an existing MS Access application to a full VB.NET application. My experience is with VB6 so I want to ask a few questions and get some input on the...
2
by: thechaosengine | last post by:
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...
1
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
0
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
14
by: ApexData | last post by:
In my database, I uniformly handle records on a Record by Record basis, in a single form that contains New/Edit/Del buttons. Because I'm dealing with records one at a time, I can easily manage my...
3
by: Phillip Taylor | last post by:
I have made my own custom control. It looks like a single line textbox with icons on the right hand side. It pretty much has the same functionality as Microsoft Outlooks "To" field, where you can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.