private void buttonOK_Click(object sender, EventArgs e) { List <string> friends = new List <string>(); friends.Add(textBoxUserName.Text); string nickname = textBoxNickName.Text; if (form != null) { form.BeginInvoke((Action) delegate { form.addFriend(nickname, friends); }); } this.Close(); }
private void buttonOK_Click(object sender, EventArgs e) { List <string> friends = new List <string>(); foreach (object o in listBoxFriend.Items) { friends.Add((string)o); } string nickname = textBoxGroupName.Text; if (form != null) { form.BeginInvoke((Action) delegate { form.addFriend(nickname, friends); }); } this.Close(); }