private void Btn_Send_Click(object sender, RoutedEventArgs e) { TB_ChatBox.AppendText("[Server]: " + TB_InputBox.Text + "\n"); Net.TCPServer.BroadcastChatMessage(TB_InputBox.Text); TB_InputBox.Text = ""; TB_ChatBox.ScrollToEnd(); }
private void InputBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { TB_ChatBox.AppendText("[Server]: " + TB_InputBox.Text + "\n"); Net.TCPServer.BroadcastChatMessage(TB_InputBox.Text); TB_InputBox.Text = ""; TB_ChatBox.ScrollToEnd(); } }