public Chat(Client.Client client) { InitializeComponent(); this.client = client; Thread updateTextThread = new Thread(new ThreadStart(UpdateTextBox)); updateTextThread.Start(); }
private void button_connect_Click(object sender, EventArgs e) { try { Client.Client client = new Client.Client(textNickname.Text, textIP.Text, textPort.Text); SetVisibleCore(false); Chat chat = new Chat(client); chat.Show(); } catch (Exception ex) { MessageBox.Show( ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); } }