In TextBox_Leave event i need to check whether numbers entered in textbox is in serial number or not.If it is not in order then i need to display a message as \"number\" is
I will show you how to validate Validating WinForms TextBox (in C#).
Create a function:
public static void ChkBlankTextBoxes(object sender, string type)
{
if (sender is TextBox)
{
TextBox textbox = sender as TextBox;
if (string.IsNullOrEmpty(textbox.Text))
{
MessageBox.Show("Please enter correct value value..");
textbox.Focus();
}
}
}
Call to created function:
ChkBlankTextBoxes(txt_userID, textBoxtype);
ChkBlankTextBoxes(txt_password, textBoxtype);