Note that there are some explanatory texts on larger screens.

plurals
  1. POStatus Label not updating on background worker progress update
    text
    copied!<p>I have seen similar questions previously, but none seem to fit my situation. I have a windows form, the form has a background worker, the worker supports updating. I have a status strip label.</p> <p>The background worker is started by a button click, when the button is clicked the background worker starts fine. Every iteration I do a progress update, sending a string as the user state. If I use that string to update the title of the form, the title changes as the process is run, and works as expected... however, if I attempt to use that string to update the value of a status strip label, the label does not get updated.</p> <p>I am doing the work on a separate thread then the UI thread, and I am not blocking the UI thread in anyway, this is evident by watching the title update as expected. However the status strip label is not updating.</p> <p>Apparently, status strip labels are not a subclass of System.Windows.Controls, however I have tried to invalidate the status strip label, and I have attempted to invalidate and refresh the status strip where the status strip label is located, however I can not get the status strip label to change text while the background working is working.</p> <p>Here is the code for the Progress Changed event</p> <pre><code> void workerThread_ProgressChanged(object sender, ProgressChangedEventArgs e) { //_statusCurrentActivityLBL.Text = e.UserState.ToString(); String s = e.UserState.ToString(); Text = s; _statusCurrentActivityLBL.Text = s; _statusCurrentActivityLBL.Invalidate(); statusStrip1.Invalidate(); statusStrip1.Refresh(); } </code></pre> <p>as i said, the Windows forms Text changes correctly, but the status label does not. </p> <p>UPDATE @Richard Schneider The Class name of the Label is ToolStripStatusLabel It does not seem to have a Refresh() member.</p> <p>UPDATE 2 @Chibueze Opata The code runs with no errors. The title text will change, if I update the text on a simple label control the label updates (That is my current work around). The problem is that the ToolStripStatusLabel, on a status strip does not get updated. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload