FRMessageBox.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. /// <summary>
  36. /// Shows the Message Box with warning message.
  37. /// </summary>
  38. /// <param name="msg">The message.</param>
  39. public static void Warning(string msg)
  40. {
  41. MessageBox.Show(msg, Res.Get("Messages,Warning"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
  42. }
  43. }
  44. }