Пример #1
0
 /// <summary>
 /// Show custom MessageBox with message, title, icon, button
 /// </summary>
 /// <param name="message">Message of message box</param>
 /// <param name="title">Title of message box</param>
 /// <param name="icon">Icon of message box</param>
 /// <param name="messageBoxButton">Button that show in message box</param>
 /// <returns></returns>
 public static DialogResult ShowCustomMessageBox(string message, string title, Common.Config.CUSTOM_MESSAGEBOX_ICON icon, Common.Config.CUSTOM_MESSAGEBOX_BUTTON messageBoxButton)
 {
     messageBox = new PassMessageBox();
     messageBox.lblMessage.Text = message;
     messageBox.lblTitle.Text   = title;
     if (icon == Common.Config.CUSTOM_MESSAGEBOX_ICON.Information)
     {
         //messageBox.pbIcon.BackgroundImage = Properties.Resources.information;
     }
     if (icon == Common.Config.CUSTOM_MESSAGEBOX_ICON.Error)
     {
         //messageBox.pbIcon.BackgroundImage = Properties.Resources.error;
     }
     if (messageBoxButton.Equals(Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK))
     {
         messageBox.btnCancel.Visible = false;
         messageBox.btnAccept.Visible = false;
         messageBox.btnOK.Location    = messageBox.btnCancel.Location;
     }
     if (messageBoxButton.Equals(Common.Config.CUSTOM_MESSAGEBOX_BUTTON.YESNO))
     {
         messageBox.btnOK.Visible = false;
     }
     messageBox.ShowDialog();
     return(dialogResult);
 }
Пример #2
0
 /// <summary>
 /// Show custom MessageBox with title
 /// </summary>
 /// <param name="title">Title of message box</param>
 /// <returns></returns>
 public static DialogResult ShowCustomMessageBox(string title)
 {
     messageBox = new PassMessageBox();
     messageBox.lblTitle.Text = title;
     messageBox.ShowDialog();
     messageBox.btnOK.Visible = false;
     return(dialogResult);
 }
Пример #3
0
 /// <summary>
 /// Show custom MessageBox with title, messageButton
 /// </summary>
 /// <param name="title"></param>
 /// <param name="messageButton"></param>
 /// <returns></returns>
 public static DialogResult ShowCustomMessageBox(string title, Common.Config.CUSTOM_MESSAGEBOX_BUTTON messageButton)
 {
     messageBox = new PassMessageBox();
     messageBox.lblTitle.Text = title;
     if (messageButton.Equals(Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK))
     {
         messageBox.btnAccept.Visible = false;
         messageBox.btnCancel.Visible = false;
         messageBox.btnOK.Location    = messageBox.btnCancel.Location;
     }
     if (messageButton.Equals(Common.Config.CUSTOM_MESSAGEBOX_BUTTON.YESNO))
     {
         messageBox.btnOK.Visible = false;
     }
     messageBox.ShowDialog();
     return(dialogResult);
 }