Markarina
unread,Dec 15, 2009, 12:53:56 PM12/15/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I'm using some very basic code found in the visual studio help to do
some error checking on values entered on a form, it all works fine
until I try to do validation on a numericupdown control, and then I
get stuck in the control I am validating. Validation code is below:
private void numericUpDown2_Validated(object sender, EventArgs
e)
{
// If all conditions have been met, clear the
ErrorProvider of errors.
errorProvider1.SetError(numericUpDown1, "");
}
private void numericUpDown2_Validating(object sender,
CancelEventArgs e)
{
if ((numericUpDown2.Value + numericUpDown2.Value) > 8)
{
// Cancel the event and select the text to be
corrected by the user.
e.Cancel = true;
// Set the ErrorProvider error with the text to
display.
this.errorProvider1.SetError(numericUpDown2, "Data
cannot go beyond message bounds, offset + number of bytes must be less
than or equal to 8");
}
}