private void button6_Click(object sender, EventArgs e) { client.BeginJoinNCRoom(ar => { var a = (NCAsyncResult)ar; showResult(a); if (a.BaseResult == baseResult.Successful) { Invoke(new Action(() => { label4.Text = "roomid:" + textBox1.Text; })); } }, textBox1.Text, textBox2.Text); }