Advertisement
Guest User

Strolz der Hurensohn

a guest
Oct 9th, 2015
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  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.  
  11. namespace test
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.            
  19.             backgroundWorker1.WorkerReportsProgress = true;
  20.             backgroundWorker1.RunWorkerAsync();
  21.            
  22.         }
  23.  
  24.         private void backgroundWorker1_DoWork_1(object sender, DoWorkEventArgs e)
  25.         {
  26.             for (int i = 1; i <= 100; i++)
  27.             {
  28.                 Console.WriteLine("schella");
  29.                 backgroundWorker1.ReportProgress(i, "3878/939");
  30.             }
  31.         }
  32.  
  33.         private void backgroundWorker1_ProgressChanged_1(object sender, ProgressChangedEventArgs e)
  34.         {
  35.             progressBar1.Value = e.ProgressPercentage;
  36.             // Set the text.
  37.             this.Text = e.ProgressPercentage.ToString();
  38.             string variable1 = e.UserState.ToString().Substring(0, e.UserState.ToString().IndexOf('/'));
  39.             string variable2 = e.UserState.ToString().Substring(e.UserState.ToString().LastIndexOf('/') + 1);
  40.             MessageBox.Show(variable1);
  41.             MessageBox.Show(variable2);
  42.         }
  43.  
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement