tags:

views:

151

answers:

3

hi, i am developing a windows application using C#.net and i am having a combobox with some list items .on selected index changed event of the combo box i need to have the progess bar to be visible and should disappear after retrieving some data. i am trying inthe way: for (int i = progressBar1.Minimum; i <= progressBar1.Maximum; i++) { progressBar1.PerformStep(); } panel1.Visible = false; where my progress bar is placed in panel1. but i am getting the progess bar when i first run my application after that when ever combobox item is changed the progress abr is not visible. i need the solution asap...

Thanks in advance!

A: 

Try panel1.Visible = true; at the start of your on selected index changed event of the combo box.

Bing
initially it is set to true anly .but i am not getting the progressbar on selected index changed
A: 

I don't see the code that would make the Panel visible again and you would also need to reset the ProgressBar before updating it again by changing the Value property to zero.

jasonh
A: 
private void comboBox1_SelectedIndexChanged(...)
{  
    progressBar1.Value=progressBar1.Minimum;
    panel1.Visible = true;
    for (int i = progressBar1.Minimum; i <= progressBar1.Maximum; i++) 
    { 
    progressBar1.PerformStep(); 
    } 
    panel1.Visible = false
}

This should make the panel1 visible, however, I'm not sure what you mean by:

"and should disappear after retrieving some data"

and if the solution of filling the progress bar solves it.

AlexDrenea
Thank You! its working fine!