"Chris Dunaway" <dunawayc@gmail.com> schrieb:
>> I know how to set the message for an ErrorProvider through code when
>> handling a validating event, however, I would like to use the message
[quoted text clipped - 6 lines]
>
> Perhaps that is what you need?
Note that this will only work if you have not reset/changed the assigned
text using 'SetError' previously.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
djmiller9975@hotmail.com - 29 Sep 2006 22:18 GMT
Do you have any suggestions on how to use this? What is the purpose of
provding the property as design time? In order to clear an error when
it happens, you have to set the error message for the control to ""
esentially changing the property.
Also, using the geterror method of the error provider doesn't return
anything until after you set the error. Here's what I was hoping to
do;
Set one event handler for several textbox controls that cannot be left
blank and use the following code as part of the validating event:
Dim ctrl As Control = DirectCast(sender, Control)
If Len(ctrl.Text) = 0 Then
ErrorProvider1.SetError(ctrl, ErrorProvider1.GetError(ctrl))
Else
ErrorProvider1.SetError(ctrl, "")
End If
I was hoping this would use the Error on ErrorProvider1 property of the
corresponding control.
Any suggestions?
Thanks,
> "Chris Dunaway" <dunawayc@gmail.com> schrieb:
> >> I know how to set the message for an ErrorProvider through code when
[quoted text clipped - 15 lines]
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>