private void buttonSend_Click(object sender, System.EventArgs e) { if ((tabMessages.SelectedIndex < 0) || (textBoxMessage.Text.Length <= 0)) { return; } Crownwood.Magic.Controls.TabPage messagePage = tabMessages.TabPages[tabMessages.SelectedIndex]; InterfaceClient client = (InterfaceClient)messagePage.Tag; RichTextBox textBox = (RichTextBox)messagePage.Control; textBox.Text += DateTime.Now.ToString() + "->" + textBoxMessage.Text + "\r\n"; Win32.SendMessage(textBox.Handle, Win32.WM_VSCROLL, (IntPtr)Win32.SB_BOTTOM, (IntPtr)0); krnGateway.SendChatMessage(client.ID, client.Port, client.ServerIP, client.UserHash, textBoxMessage.Text); textBoxMessage.Text = ""; }