private void Network_ChatEventHandler(object sender, ChatEvent e) { ChatBox.BeginInvoke((MethodInvoker) delegate { int st = ChatBox.TextLength; ChatBox.SelectionFont = BoldFont; ChatBox.SelectionBackColor = Color.DarkCyan; ChatBox.AppendText(e.message.OwnerName + ":"); ChatBox.Select(st, ChatBox.TextLength - st); ChatBox.SelectionFont = StdFont; ChatBox.DeselectAll(); st = ChatBox.TextLength; ChatBox.AppendText(e.message.Message + "\r\n"); ChatBox.Select(st, ChatBox.TextLength - st); ChatBox.SelectionBackColor = Color.Black; ChatBox.DeselectAll(); ChatBox.ScrollToCaret(); AddMessage(e.message); }); if (e.message.MessageID == IncrementID) { ChatBoxMessage.Invoke((MethodInvoker) delegate { ChatBoxMessage.Text = ""; IncrementID++; ChatBoxMessage.Focus(); }); } }