Yes. Stop doing that.
Don't use Show - use ShowDialog:
private void btnLogin_Click(object sender, EventArgs e)
{
try
{
UserApplication user = new UserApplication(userName);
Hide();
user.ShowDialog();
Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
And
private void btnLogout_Click(object sender, EventArgs e)
{
Close();
}
Will fix it for you.