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
Alternatively you can also use Validating event of the text box.
private void textBox1_Validating( object sender, CancelEventArgs e ) { if ( textBox1.Text == "3" ) e.Cancel = true; }
The text-box wont loose focus until it receives a valid input.