public void AddMessage(string text, MessagePanelColor color) { if (this.messageLabel.InvokeRequired) this.messageLabel.Invoke(new AddMessageDelegate(AddMessage), text, color); else { this.messageLabel.Text = text; this.messageLabel.Font = new Font(this.messageLabel.Font, FontStyle.Bold); switch (color) { case MessagePanelColor.Error: this.messageLabel.ForeColor = Color.Firebrick; break; case MessagePanelColor.Message: this.messageLabel.ForeColor = Color.DarkGreen; break; } } }
public void AddMessage(string text, MessagePanelColor color) { if (this.messageLabel.InvokeRequired) { this.messageLabel.Invoke(new AddMessageDelegate(AddMessage), text, color); } else { this.messageLabel.Text = text; this.messageLabel.Font = new Font(this.messageLabel.Font, FontStyle.Bold); switch (color) { case MessagePanelColor.Error: this.messageLabel.ForeColor = Color.Firebrick; break; case MessagePanelColor.Message: this.messageLabel.ForeColor = Color.DarkGreen; break; } } }