예제 #1
0
        private void addMessage(string message, bool sent)
        {
            Color color = sent == true?Color.FromArgb(153, 102, 153) : Color.FromArgb(0, 153, 0);

            MessageLabel messagelabel = MessageLabel.create(message, chatBox, color);

            self.chatBox.Controls.Add(messagelabel);
            if (self.chatBox.Controls.Count > 25)
            {
                self.chatBox.Controls.RemoveAt(0);
            }
            self.chatBox.VerticalScroll.Value = chatBox.VerticalScroll.Maximum;
            self.chatBox.PerformLayout();
        }