public void SetButton(KxMsgBoxButton btn) { switch (btn) { case KxMsgBoxButton.OK: { MsgBox.button_OK.Location = new Point(390, 90); MsgBox.button_OK.Visible = true; break; } case KxMsgBoxButton.YESNO: { MsgBox.button_YES.Location = new Point(390, 90); MsgBox.button_YES.Visible = true; MsgBox.button_NO.Location = new Point(310, 90); MsgBox.button_NO.Visible = true; break; } case KxMsgBoxButton.OKCANCEL: { MsgBox.button_OK.Location = new Point(390, 90); MsgBox.button_OK.Visible = true; MsgBox.button_CANCEL.Location = new Point(310, 90); MsgBox.button_CANCEL.Visible = true; 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); }