public void setMessage(string message, ConfigMessageIconEnum icon)
 {
     setMessageIcon(icon);
     txtMessage.Invoke(new Action(() =>
     {
         txtMessage.Text = message;
     }));
 }
        private void setMessageIcon(ConfigMessageIconEnum icon)
        {
            switch (icon)
            {
            case ConfigMessageIconEnum.Ok:
                iconMessage.BackgroundImage = Properties.Resources.ok;
                break;

            case ConfigMessageIconEnum.Error:
                iconMessage.BackgroundImage = Properties.Resources.error;
                break;

            case ConfigMessageIconEnum.Information:
                iconMessage.BackgroundImage = Properties.Resources.info;
                break;

            case ConfigMessageIconEnum.Warning:
                iconMessage.BackgroundImage = Properties.Resources.warning;
                break;
            }
        }