Simple - add an else clause:
if (string.IsNullOrEmpty(txtPassword.Text) || (string.IsNullOrEmpty(textbox8.Text)))
MessageBox.Show("field empty.", "Error", MessageBoxButtons.OK,
else
{
MessageBoxIcon.Warning);
Files mf = new Files();
Hide();
mf.ShowDialog();
Close();
}
BTW: it's a good idea (especially when you are just starting out) to always add the curly brackets, even if it's just one line:
if (string.IsNullOrEmpty(txtPassword.Text) || (string.IsNullOrEmpty(textbox8.Text)))
{
MessageBox.Show("field empty.", "Error", MessageBoxButtons.OK,
}
else
{
MessageBoxIcon.Warning);
Files mf = new Files();
Hide();
mf.ShowDialog();
Close();
}
That way, it's immediately obvious what is expected to happen.
And please, do yourself a favour, and stop using Visual Studio default names for everything - you may remember that "TextBox8" is the mobile number today, but when you have to modify it in three weeks time, will you then? Use descriptive names - "tbMobileNo" for example - and your code becomes easier to read, more self documenting, easier to maintain - and surprisingly quicker to code because Intellisense can get to to "tbMobile" in three keystrokes, where "TextBox8" takes thinking about and 8 keystrokes...