FRMessageBox.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Windows.Forms;
  2. namespace FastReport.Utils
  3. {
  4. /// <summary>
  5. /// Provides the message functions.
  6. /// </summary>
  7. public static class FRMessageBox
  8. {
  9. /// <summary>
  10. /// Shows the Message Box with error message.
  11. /// </summary>
  12. /// <param name="msg">The message.</param>
  13. public static void Error(string msg)
  14. {
  15. MessageBox.Show(msg, Res.Get("Messages,Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
  16. }
  17. /// <summary>
  18. /// Shows Message Box with confirmation.
  19. /// </summary>
  20. /// <param name="msg">The message.</param>
  21. /// <param name="buttons">The dialog buttons.</param>
  22. /// <returns>The dialog result.</returns>
  23. public static DialogResult Confirm(string msg, MessageBoxButtons buttons)
  24. {
  25. return MessageBox.Show(msg, Res.Get("Messages,Confirmation"), buttons, MessageBoxIcon.Question);
  26. }
  27. /// <summary>
  28. /// Shows information Message Box.
  29. /// </summary>
  30. /// <param name="msg">The message.</param>
  31. public static void Information(string msg)
  32. {
  33. MessageBox.Show(msg, Res.Get("Messages,Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
  34. }
  35. }
  36. }