I already can make the login for user, so if user type their username or password wrongly in textbox, the message label that says "Invalid username or password" appear. But, i want to when user type a single character or number in textbox when the message label is appear, the message label will not visible to user (visible = false) as user already type a single character or number in textbox. But the message label didn't disappear when user type a single character or number.
This is the code:
private void CheckTextBox(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrEmpty(textBox2.Text)) { label5.Visible = true; } else { label5.Visible = false; } } And here is the image:
Below image is when user type wrongly (the username or password), the message label appear:

Below image is when user type a single character or number, but the message label still at there

My question is: How do i set the message label to not show when user type a single character or number in the textbox?
Any help?
Your answer will be great appreciated!
Thank you!
CheckTextBoxmethod is wired up to theTextChangedevent of the checkbox.