/// <summary> /// ใช้ในกรณีที่มี ErrorNo /// </summary> /// <param name="title"></param> /// <param name="message"></param> /// <param name="errorNo"></param> public static DialogResult ShowMessageDialog(string title, string message, string messageType, string errorNo = "00" , int?x = null, int?y = null) { using (MessageBoxDialog frm = new MessageBoxDialog()) { frm.Title = title; frm.ErrorMessage = message; frm.MessageType = messageType; frm.TopMost = true; if (x.HasValue && y.HasValue) { frm.Location = new Point(x.Value, y.Value); } else { frm.StartPosition = FormStartPosition.CenterScreen; } if (errorNo == "00" || errorNo == "") { frm.ErrorNo = "-"; } else { frm.ErrorNo = errorNo; } return(frm.ShowDialog()); } }
public static void ShowMessage(string title, string message, string messageType, string errorNo = "00") { MessageBoxDialog frm = new MessageBoxDialog(); frm.Title = title; frm.ErrorMessage = message; frm.MessageType = messageType; if (errorNo == "00" || errorNo == "") { frm.ErrorNo = "-"; } else { frm.ErrorNo = errorNo; } frm.Show(); frm.TopMost = true; frm.StartPosition = FormStartPosition.CenterScreen; }