validating multiple controls

  • Thread starter George Chatzigeorgiou
  • Start date
G

George Chatzigeorgiou

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
 
N

Nick Malik [Microsoft]

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.
 

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