in

vbCity Blogs

New (temp) place for vbCity Blogs

Mike McIntyre's .NET Journal

Validation and the Windows Forms ErrorProvider

Download source code here ->  Validation and the Windows Forms ErrorProvider Component

I've noticed that not a lot of people take advantage of the Windows Forms built in user interface for indicating that a control on a form has an error associated with it - the ErrorProvider component.

The ErrorProvider presents a simple mechanism for indicating to the end user that a control on a form has an error associated with it. If an error description string is specified for the control, an icon appears next to the control. The icon flashes in the manner specified by BlinkStyle, at the rate specified by BlinkRate. When the mouse hovers over the icon, a ToolTip appears showing the error description string.

Typically, you use ErrorProvider in association with data-bound controls. When using ErrorProvider with data-bound controls, you must specify the ContainerControl, either in the constructor or by setting the ContainerControl property.

The Visual Studio project download at the link above demonstrates how to combine validation with the ErrorProvider.

 

Mike McIntyre's .Net Journal

getdotnetcode.com

Only published comments... Oct 10 2009, 08:03 PM by Mike McIntyre

About Mike McIntyre

I  am a programmer, developer, and system architect with 29+years experience including state-of-the-art application development frameworks and languages including Visual Studio versions 2002-2010, .NET Framework versions 1-4, C#, and Visual Basic.

I am a mentor, trainer, and coach in the Microsoft .NET technical community. DevCity is my favorite community site. You can find examples of my involvement with DevCity in the site articles, newsletter articles, and my posts in the forum.

Since 2002 I have hosted a .NET site at http://www.getdotnetcode.com, a place with free and inexpensive Visual Basic and C# source code that can be purchased on an 'as needed' basis.

In 2007 I established a .NET search engine, 'Resources for .NET Developers' at http://dot-net-resources-swicki.eurekster.com

Copyright 1998-2009 vbCity.com LLC
Powered by Community Server (Non-Commercial Edition), by Telligent Systems