public alert(string _message, Alertype type) { InitializeComponent(); message.Text = _message; switch (type) { case Alertype.succes: this.BackColor = Color.SeaGreen; pictureBox.Image = imageList1.Images[0]; break; case Alertype.info: this.BackColor = Color.FromArgb(31, 139, 188); pictureBox.Image = imageList1.Images[1]; break; case Alertype.warning: this.BackColor = Color.FromArgb(255, 128, 0); pictureBox.Image = imageList1.Images[2]; break; case Alertype.error: this.BackColor = Color.Red; pictureBox.Image = imageList1.Images[3]; break; } }
/// <summary> /// Alerts the specified message. /// </summary> /// <param name="message"></param> /// <param name="type"></param> public static void Show(string message, Alertype type) { new alert(message, type).Show(); }