FieldValidators in Windows Forms


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: FieldValidators in Windows Forms

  1. #1
    Willy Van den Driessche Guest

    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



  2. #2
    Phil Weber Guest

    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



  3. #3
    Willy Van den Driessche Guest

    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>



  4. #4
    Phil Weber Guest

    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



  5. #5
    Willy Van den Driessche Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center