public void AppendTextBox(string value) { if (InvokeRequired) { this.Invoke(new Action <string>(AppendTextBox), new object[] { value }); return; } ChatBox.AppendText(value + System.Environment.NewLine); }
// Print a string to the ChatBox and add the message to the list. public void AppendTextBox(List <string> L, string value) { if (InvokeRequired) { this.Invoke(new Action <List <string>, string>(AppendTextBox), new object[] { L, value }); return; } ChatBox.AppendText(value); }
private void PrintMessage(string message) { if (InvokeRequired) { Invoke(_addMessage, message); return; } ChatBox.SelectionStart = ChatBox.TextLength; ChatBox.SelectionLength = message.Length; ChatBox.AppendText(message + Environment.NewLine); }
public PictionaryForm(ClientManager client) { InitializeComponent(); ColorComboBox.SelectedIndex = 7; linePointsX = new List <double>(); linePointsY = new List <double>(); clientManager = client; newLine = true; paintTool = PaintTool.Pen; penColor = Colors.Black; ColorComboBox.ItemsSource = typeof(Colors).GetProperties(); ChatBox.Foreground = new SolidColorBrush(Colors.Gray); PaintCanvas.DefaultDrawingAttributes.Width = 2; ChatBox.AppendText("Welcome to Pictionary!"); }