コード例 #1
0
ファイル: CChatControl.cs プロジェクト: BigFun123/Massive
        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();
                });
            }
        }
コード例 #2
0
ファイル: CChatControl.cs プロジェクト: BigFun123/Massive
 private void CChatControl_Load(object sender, EventArgs e)
 {
     ChatBoxMessage.Focus();
     ChatBoxMessage.SelectedText = "";
 }
コード例 #3
0
ファイル: CChatControl.cs プロジェクト: BigFun123/Massive
 public void Setup()
 {
     ChatBoxMessage.Focus();
     ChatBoxMessage.SelectedText = "";
 }