private void LoginButton_Click(object sender, EventArgs e) { if (LoginButton.Text == "Login" && pCollection != null) { User.ProfileWindow pw = new User.ProfileWindow(pCollection); pw.ShowDialog(); if (pw.rv != null) { LoginButton.Text = "Logout"; this.Text = "Chess: " + pw.rv.NickName; } } else { this.Text = "Chess"; LoginButton.Text = "Login"; } }