how to show a message afer progress bar finished

Posted by Shanky11 under WPF on 8/8/2013 | Points: 10 | Views : 1475 | Status : [Member] | Replies : 1
here is my code its runung but the pblm is i hav to show a message that scan finishes
how can i do that tell me
how can i chk the condition that progress bar finishes

public partial class MainWindow : Window
{

DispatcherTimer dt = new DispatcherTimer();
Stopwatch stopWatch = new Stopwatch();
string currentTime = string.Empty;

public MainWindow()
{
InitializeComponent();
dt.Tick += new EventHandler(dt_Tick);
dt.Interval = new TimeSpan(0, 0, 0, 0, 1);
}


void dt_Tick(object sender, EventArgs e)
{
if (stopWatch.IsRunning)
{
TimeSpan ts = stopWatch.Elapsed;
currentTime = ts.Seconds.ToString();
Progressbar1.Value = Convert.ToInt32(currentTime);
}
}

private void Button_Click_1(object sender, RoutedEventArgs e)
{
stopWatch.Start();
dt.Start();

}

private void Button_Click_2(object sender, RoutedEventArgs e)
{
if (stopWatch.IsRunning)
stopWatch.Stop();
}
}
}




Responses

Posted by: Bandi on: 8/8/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
You can use BackGroundWorker for progess bar
http://stackoverflow.com/questions/5503136/wpf-progressbar-make-the-progress-bar-completed-after-the-operation-finished

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response