private void newEntriesToolStripMenuItem_Click(object sender, EventArgs e) { Forms.SuppliesAvailability F = new SuppliesAvailability(); F.MdiParent = this; F.Show(); } //When I clicked newEntriesToolStripMenuItem_Click form 1 must run this code while loading the form "backgroundWorker1.RunWorkerAsync();" public void Main_Load(object sender, EventArgs e) { backgroundWorker1.RunWorkerAsync(); } public void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { // Change the value of the ProgressBar to the BackgroundWorker progress. progressBar1.Value = e.ProgressPercentage; // Set the text. toolStripStatusLabel2.Text = e.ProgressPercentage.ToString(); } public void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { for (int i = 1; i <= 100; i++) { // Wait 100 milliseconds. Thread.Sleep(10); // Report progress. backgroundWorker1.ReportProgress(i); } }</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)