Example #1
0
 /// <summary>
 /// Show custom MessageBox with message, title and icon
 /// </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>
 /// <returns></returns>
 public static DialogResult ShowCustomMessageBox(string message, string title, Common.Config.CUSTOM_MESSAGEBOX_ICON icon)
 {
     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.thoat;
     }
     messageBox.btnOK.Visible = false;
     messageBox.ShowDialog();
     return(dialogResult);
 }
Example #2
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);
 }