if (!validateNum(textBox1.Text.Trim()))
{ errorP.SetError(textBox1,"wrong!");
errorP2.Clear();
}
else if (!validateNum(textBox2.Text.Trim()))
{
errorP2.SetError(textBox2, "wrong!");
errorP.Clear();
}
else
{
errorP2.Clear();
errorP.Clear();
}
如何改为try-catch-catch-finally.
{ errorP.SetError(textBox1,"wrong!");
errorP2.Clear();
}
else if (!validateNum(textBox2.Text.Trim()))
{
errorP2.SetError(textBox2, "wrong!");
errorP.Clear();
}
else
{
errorP2.Clear();
errorP.Clear();
}
如何改为try-catch-catch-finally.
{
if (!validateNum(textBox1.Text.Trim()))
{ errorP.SetError(textBox1,"wrong!");
errorP2.Clear();
}
else if (!validateNum(textBox2.Text.Trim()))
{
errorP2.SetError(textBox2, "wrong!");
errorP.Clear();
}
else
{
errorP2.Clear();
errorP.Clear();
} }
catch
{
}
finally{}