StatusStrip ProgressBar

G

Guest

Since some controls such as the DataGridView take a long time to update
themselves when performing certain tasks, I have added a StatusStrip with a
ProgressBar on it. While I am updating the controls on the form, I want the
ProgressBar to scroll in marquee mode. However, I cannot seem to get this to
work.

I set the StatusStripLabel to the text I want such as "Updating data..." and
then set the ProgressBar's Style property to Marquee mode BEFORE I do any
updates on the controls in the same form. However, the StatusStripLabel does
not display the text and the ProgressBar does not scroll in marquee mode
while I am performing the updates. This does not seem logical to me and I
have no idea why this occurs. Can anybody please help me?
 
W

wfairl

Since some controls such as the DataGridView take a long time to update
themselves when performing certain tasks, I have added a StatusStrip with a
ProgressBar on it. While I am updating the controls on the form, I want the
ProgressBar to scroll in marquee mode. However, I cannot seem to get this to
work.

I set the StatusStripLabel to the text I want such as "Updating data..." and
then set the ProgressBar's Style property to Marquee mode BEFORE I do any
updates on the controls in the same form. However, the StatusStripLabel does
not display the text and the ProgressBar does not scroll in marquee mode
while I am performing the updates. This does not seem logical to me and I
have no idea why this occurs. Can anybody please help me?

You're blocking on the UI thread? If so then that's preventing the UI
updates. Look into using a BackgroundWorker (I'm assuming you're
using .net 2.0 if you're using a DataGridView).
 
G

Guest

I tried using the BackgroundWorker, but I can't reference the DataGridView in
the DoWork method because the DataGridView is on the UI thread. I think the
StatusBar probably needs to be in its own thread so that it's constantly
repainting while I update the DataGridView. But, how do you put a Windows
Control in a different thread when it's on the same form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top