void UpdateConsoleMessages()
 {
     for (int i = 0; i < ConsoleMessagePanel.Controls.Count; i++)
     {
         ConsoleMessagePanel panel = (ConsoleMessagePanel)ConsoleMessagePanel.Controls[i];
         panel.Size = new Size(ConsoleMessagePanel.Size.Width, 20);
         panel.messageLabel.Size = panel.Size;
     }
     ConsoleMessagePanel.Refresh();
 }
        public void AddNewMessage(string _message)
        {
            ConsoleMessagePanel newMessage = new ConsoleMessagePanel(_message);

            ConsoleMessagePanel.Controls.Add(newMessage);
            newMessage.Size     = new Size(ConsoleMessagePanel.Size.Width, 20);
            newMessage.Location = new Point(0, (ConsoleMessagePanel.Controls.Count - 1) * 21);
            messageControls.Add(newMessage);
            UpdateConsoleMessages();
        }
 private void EreaseButton_Click(object sender, EventArgs e)
 {
     if (ConsoleMessagePanel.Controls.Count > 0)
     {
         foreach (Control c in messageControls)
         {
             c.Dispose();
         }
         messageControls.Clear();
         ConsoleMessagePanel.Refresh();
     }
 }