473,396 Members | 1,963 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,396 software developers and data experts.

validating multiple controls

Hi all.

Since I started with .net I have this feeling, that there is no easy way
of validating mulitple controls on forms, menus etc. Suppose our
application has an MDI , a toolbar , a menu, and some child forms. If I
want to update all controls (toolbar buttons, menu items etc), I have to
capture all events of all controls that affect the states of the
controls mentioned. Be for I go on and write something of my own,
thought I make sure I'm not missing anything important here.

I used to work with another framework, where things on this matter were
much simpler. You could capture an Application.OnUpdate event, and put
all your validation code in there. You could do everything with two or
three methods, and then just assign the OnUpdate event of every control
to the desired method. So I'm wondering if there is anything like it, in
the .net framework.

Thanks for any help
Jul 21 '05 #1
1 1248
Not sure how that is all that different from .Net

Just create some static methods representing changes in application state
(in OO, I'd say create an application object, and provide properties for the
changes in condition that drive the U/I). Then, in each event handler, call
your methods (or OO object).

If an event handler is one line long, how is that so bad?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"George Chatzigeorgiou" <ba****@e-spark.gr> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi all.

Since I started with .net I have this feeling, that there is no easy way
of validating mulitple controls on forms, menus etc. Suppose our
application has an MDI , a toolbar , a menu, and some child forms. If I
want to update all controls (toolbar buttons, menu items etc), I have to
capture all events of all controls that affect the states of the controls
mentioned. Be for I go on and write something of my own, thought I make
sure I'm not missing anything important here.

I used to work with another framework, where things on this matter were
much simpler. You could capture an Application.OnUpdate event, and put all
your validation code in there. You could do everything with two or three
methods, and then just assign the OnUpdate event of every control to the
desired method. So I'm wondering if there is anything like it, in the .net
framework.

Thanks for any help

Jul 21 '05 #2

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

Similar topics

0
by: Joe | last post by:
Hi For a while now I have been finding postings of problems with the validating event not firing on controls properly. I too had this problem. The event would fire when clicking on another...
2
by: Osmosis | last post by:
I have a form with several controls, which all have their validating and validated events in my code. However, if these controls don't get focus, these events don't get called. When my OK...
2
by: Chris Dunaway | last post by:
I have a form with a textbox and numerous panels, buttons and other controls. I have handled the textbox Validating and Validated events. The textbox will hold a filename. In the validating...
0
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls...
0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
1
by: George Chatzigeorgiou | last post by:
Hi all. Since I started with .net I have this feeling, that there is no easy way of validating mulitple controls on forms, menus etc. Suppose our application has an MDI , a toolbar , a menu, and...
0
by: Bryan | last post by:
Visual basic 2005, .net 2.0: I pass my form's collection of controls to a public sub in a module that loops through and checks for any ErrorProvider text. The sub returns all the ErrorProvider...
3
by: TheSteph | last post by:
Hi Experts ! I have a Winform Program in C# / .NET 2.0 I would like to ensure that a value in a TextBox is a valid Int32 when user get out of it (TextBox loose focus)
1
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I've noticed that controls do not raise a Validating event if they are contained in a ToolStripDropDown via a ToolStripControlHost item. Please run the following sample and follow the instructions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.