public void SetIcon(KxMsgBoxIcon Icon) { switch (Icon) { case KxMsgBoxIcon.ERROR: { MsgBox.pictureBox_TopIcon.BackgroundImage = Properties.Resources.delete_shield_64px; break; } case KxMsgBoxIcon.INFORMATION: { MsgBox.pictureBox_TopIcon.BackgroundImage = Properties.Resources.keyhole_shield_64px; break; } case KxMsgBoxIcon.QUESTION: { MsgBox.pictureBox_TopIcon.BackgroundImage = Properties.Resources.question_shield_64px; break; } case KxMsgBoxIcon.WARNING: { MsgBox.pictureBox_TopIcon.BackgroundImage = Properties.Resources.warning_shield_64px; break; } } }
public static DialogResult Show(string caption, string text, KxMsgBoxIcon Icon, KxMsgBoxButton Button) { MsgBox = new KxMsgBox(); MsgBox.SetIcon(Icon); MsgBox.SetButton(Button); MsgBox.pictureBox_TopIcon.Visible = true; MsgBox.label_TopCaption.Visible = true; MsgBox.label_TopCaption.Text = caption; MsgBox.label_CenterMessage.Text = text; MsgBox.label_CenterMessage.Focus(); MsgBox.TopMost = true; MsgBox.ShowDialog(); return(Result); }