|
-
Jun 28th, 2007, 10:01 PM
#1
Thread Starter
Fanatic Member
help with progressbar and Thread
hi guys! i have a code below that supposedly, Set e.Cancel to true, set the LblProgressBar (a ToolStripStatusLabel) Text Property to "Performing Backup" and Visible property to true, set the pBar(a ToolStripProgressBar) Visible property to true and call the function FuncPeformBackup using Thread after the FuncPerformBackup is finished set the e.Cancel to false, for it to close the form, But it doest not work the way I expected the LblProgressBar and pBar does not show up. I inserted 200,000 rows in one of the tables in the database for the backup to take a while and to check if the label and the progress bar will show up..but i have no luck. I just want to have a progress bar to let the user know that the application is performing backup job in background. Any suggestion guys on how can i solve this problem..Thanks!
Code:
private void RCPSIndex_FormClosing(object sender, FormClosingEventArgs e)
{
if (DBBackupRecovery.dbEnableBackup && DBBackupRecovery.dbBackupEverySysClose)
{
e.Cancel = true;
LblProgressBar.Text = "Performing Backup";
LblProgressBar.Visible = true;
pBar.Visible = true;
Thread t = new Thread(new ThreadStart(FuncPeformBackup));
t.Start();
Thread.Sleep(100);
t.IsBackground = true;
t.Join();
e.Cancel = false;
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|