How do we perform validations in windows forms,except writing IF conditions is there any easy way or method to write Validations...please explain me...it's very helpful for me in my project
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant SrivastavaPosted Sep 23, 2013, 6:09 PM
private void textBox1_Validated(object sender, EventArgs e)
{
if (Convert.ToInt32(textBox1.Text) <= 0)
{
MessageBox.Show("Invalid Number");
}
}
Similarly we could use regular expression (Regex) to check data validation too.
Satyapriya NayakPosted Sep 23, 2013, 1:21 PM
Sanjeeb LenkaPosted Sep 23, 2013, 7:02 AM
asp.net validation control will not work in windows form.
for asp.net check this link
http://www.c-sharpcorner.com/uploadfile/puranindia/validation-controls-in-Asp-Net/
rajiv reddy jPosted Sep 23, 2013, 6:56 AM
Sanjeeb LenkaPosted Sep 23, 2013, 6:51 AM