/// <summary> /// Take user back to startup form when the back button is clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void backButton_Click(object sender, EventArgs e) { this.Hide(); var startupForm = new StartupForm(serverConnection, messageService); startupForm.FormClosed += (s, args) => this.Close(); startupForm.Show(); }
/// <summary> /// Sign out of the user account and return to the startup form when the signout button is clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void logOutToolStripMenuItem_Click(object sender, EventArgs e) { TCPMessage tcpMessage = new TCPMessage(); tcpMessage.chatID = 0; tcpMessage.command = "CLOSE"; tcpMessage.message = "0"; messageService.SendMessage(tcpMessage); this.Hide(); var startupForm = new StartupForm(); startupForm.FormClosed += (s, args) => this.Close(); startupForm.Show(); }