private void loginButton_Click(object sender, EventArgs e) { if (statusLabel.Text == "Connected") { if (usernameTextBox.Text != "" && passwordTextBox.Text != "") { Tuple <bool, bool> login = network.login(usernameTextBox.Text, passwordTextBox.Text); if (login.Item1) { Form form = new FormClient(network, login.Item2, usernameTextBox.Text.ToLower()); this.Hide(); if (form.ShowDialog() == DialogResult.Cancel) { this.Dispose(); } } else { MessageBox.Show("Wrong username or password"); } } else { MessageBox.Show("Please enter a username and a password!"); } } }
// meme chose pour le client, sauf qu'on lit ce qu'il y a dans la text box private void btnClient_Click(object sender, EventArgs e) { FormClient frm = new FormClient(tBIp.Text); // On envoie l'ip choisie par le client. frm.Show(); this.Hide(); frm.FormClosing += new FormClosingEventHandler(FormClient_FormClosing); }
private void loginButton_Click(object sender, EventArgs e) { //Sending to server here: Form form = new FormClient(network); this.Hide(); if(form.ShowDialog() == DialogResult.Cancel) this.Dispose(); }
private void loginButton_Click(object sender, EventArgs e) { if (statusLabel.Text == "Connected") { if (usernameTextBox.Text != "" && passwordTextBox.Text != "") { Tuple<bool, bool> login = network.login(usernameTextBox.Text, passwordTextBox.Text); if (login.Item1) { Form form = new FormClient(network, login.Item2, usernameTextBox.Text.ToLower()); this.Hide(); if (form.ShowDialog() == DialogResult.Cancel) this.Dispose(); } else MessageBox.Show("Wrong username or password"); } else MessageBox.Show("Please enter a username and a password!"); } }
public void SetParent(FormClient parent) { this.parent = parent; }