private void HideProgressBar()
{
//test whether Invoke is required (was this call made on a different thread than the main thread?)
if (this.progressBar1.InvokeRequired)
{
//call itself on the main thread
ShowProgressBarCallBack d = new ShowProgressBarCallBack(HideProgressBar);
this.Invoke(d);
}
else
{
//set the visibility
btnRefreshList.Visible = true;
progressBar1.Visible = false;
}
}