private void buttonAddUser_Click(object sender, EventArgs e) { Form add_username = new AddUsername(parent); add_username.ShowDialog(this); string username = (add_username as AddUsername).username; if (username != "") { Form pair_user = new PairUser(username, parent.latch); pair_user.ShowDialog(this); string accountId = (pair_user as PairUser).accountId; if (accountId != "") { parent.users.Add(new User(username, accountId)); parent.toXML(); Fill_dataGridViewUsers(); } } }