-
FieldValidators in Windows Forms
I was pleased to find the components called FieldValidators
(RequiredFieldValidator, CompareValidator, RangeValidator,
RegularExpressionValidator, CustomValidator <-> ValidationSummary ) in the
webforms tab of my components. I even found a book that explains them a
bit. In short : they validate a field and allow you to visualize the error
next to the field (the message can go in another place)
In my latest project, this is the approach we take (although Validation is
done with brokenrules) for visualizing errors on the screen. Is there a
reason why there is no equivalent for the Windows Forms ?
--
Van den Driessche Willy
For a work in progress :
http://users.skynet.be/wvdd2/index.html
-
Re: FieldValidators in Windows Forms
> Is there a reason why there is no equivalent for the
> Windows Forms?
Willy: Only Microsoft can tell you why there's no direct equivalent, but
Windows Forms does include the Validate event and ErrorProvider control,
which allow you to accomplish essentially the same thing.
---
Phil Weber
-
Re: FieldValidators in Windows Forms
"Phil Weber" <pweber@_fawcette.com> wrote in message
news:3be70047$1@147.208.176.211...
> > Is there a reason why there is no equivalent for the
> > Windows Forms?
>
> Willy: Only Microsoft can tell you why there's no direct equivalent, but
> Windows Forms does include the Validate event and ErrorProvider control,
> which allow you to accomplish essentially the same thing.
Seems a bit awkward to have two different mechanisms.
Thanks Phil. Played a little with the errorprovider and I like the idea. I
guess I'll dig in a little deeper. Our current app does what the
errorprovider does with some little differences :
we have multiple errorlevels (guess this could be done with an errorprovider
per level but not quite since the most serious error icon appears).
we can have multiple errors per control which are shown in a multiline
tooltip. (could do that too with the error provider)
Anyway, thanks ! I'm beginning to see the potential.
> ---
> Phil Weber
>
--
Van den Driessche Willy
For a work in progress :
http://users.skynet.be/wvdd2/index.html>
-
Re: FieldValidators in Windows Forms
> we have multiple errorlevels (guess this could be done with
> an errorprovider per level but not quite since the most serious
> error icon appears).
Willy: You can change the icon that the ErrorProvider displays: Check out
the .Icon property.
---
Phil Weber
-
Re: FieldValidators in Windows Forms
"Phil Weber" <pweber@_fawcette.com> wrote in message
news:3be70b0a$1@147.208.176.211...
> > we have multiple errorlevels (guess this could be done with
> > an errorprovider per level but not quite since the most serious
> > error icon appears).
>
> Willy: You can change the icon that the ErrorProvider displays: Check out
> the .Icon property.
> ---
> Phil Weber
>
I saw that one. But the same icon applies to all messages. We have an icon
per error level. Some controls have warnings, others hints etc... all at
the same time. With fancy icons it's a real "color book" (nl: kleurboek)
but with the appropriate icons it's helpful. Our users love it. Especially
since the validation is not-so-obvious. They can choose for themselves
which error they tackle first. In a way it's like the background
compilation in .NET.
[In addition to these, we also display a grid with the various errors at the
bottom. Double-Clicking on an error brings you to the
most-probably-incorrect control]
I've also found the iconalignment property. Shame you can't override the
default once and then only deviate from it for special controls [ we use the
top left corner]. You're kindof forced to do it per control. Also the
SetError (myControl, "") could have been clearError (myControl).
Thanks again for the info.
--
Van den Driessche Willy
For a work in progress :
http://users.skynet.be/wvdd2/index.html>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks