=> Create project.
=> take textbox from toolbox
=> select textbox and goto propeties window and click on event tab.
=> double click on KeyLeave event.
=> write following code
CODE:
//this code is for when user leave text box without entering any number then it give error.
private void textbox1_Leave(object sender, EventArgs e)
{
if (textbox1.Text=="")
{
MessageBox.Show("Pleasr fill up the value in text box","Error");
textbox1.Focus();
}
}
--
/\/ir@\/ <(.'.)>
Thursday, 11 October 2012
Subscribe to:
Post Comments (Atom)
Try this condition:
ReplyDeleteif (string.IsNullOrWhiteSpace(textBox1.Text))