private void SendMessageButton_Click(object sender, EventArgs e) { if (SendMessageTextField.Text != "") { Client.SendMessageToServer(Client.current.id, 0, Client.current.username + ": " + SendMessageTextField.Text); SendMessageTextField.Text = null; MainChatWindow.SelectedIndex = (MainChatWindow.Items.Count - 1); MainChatWindow.ClearSelected(); } }