Keine Beschreibung

ProgressDialog.cs 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Threading;
  11. namespace BulkPrinting
  12. {
  13. public partial class ProgressDialog : Form
  14. {
  15. public ProgressDialog()
  16. {
  17. InitializeComponent();
  18. }
  19. public void UpdateProgressBar(int Percentage)
  20. {
  21. if (this.InvokeRequired)
  22. {
  23. this.Invoke((Action<int>)UpdateProgressBar, Percentage);
  24. }
  25. else
  26. {
  27. pbrProgress.Value = Percentage;
  28. pbrProgress.Refresh();
  29. }
  30. }
  31. public void UpdateProgressText(string ProgressText) {
  32. if (this.InvokeRequired)
  33. {
  34. this.Invoke((Action<string>)UpdateProgressText, ProgressText);
  35. }
  36. else
  37. {
  38. lblProgressText.Text = ProgressText;
  39. lblProgressText.Refresh();
  40. }
  41. }
  42. private void ProgressDialog_Load(object sender, EventArgs e)
  43. {
  44. }
  45. }
  46. }