I’m trying a ProgressBar with the Marquee style. I set MarqueeAnimationSpeed to 0 initially and then I have a button than when pressed it looks for the instances of Sql Server. However, when I click start the progress bar does not show anything. I’m on Windows 7 I don’t know if this might be the problem
public Form1 ()
{
InitializeComponent ();
}
private void Form1_Load (object sender, EventArgs e)
{
this.progressBar1.MarqueeAnimationSpeed = 0;
}
private void button1_Click (object sender, EventArgs e)
{
this.progressBar1.MarqueeAnimationSpeed = 50;
SqlDataSourceEnumerator sqlEnumerator = SqlDataSourceEnumerator.Instance;
DataTable dataTable = sqlEnumerator.GetDataSources ();
this.Close ();
}
More than likely your
sqlEnumerator.GetDataSources ();is blocking the main thread and that’s why you’re not seeing it animate.Threadthat call and you’ll see the marquee scrolling as it should.