473,386 Members | 1,803 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,386 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 1245
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...

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.