Label not updating on BackGroundWorker work (C#, Winforms)
I tried to search for solutions but none work so I’m asking directly. I’m using a BackGroundWorker
and while I’m drawing a Bitmap I’d like to show it in the PictureBox
. It seems tricky to do so at least I wanted to show a progress percentage in a label but the label does not update during the process. The Work calls a function passing parameters (a Bitmap and a String). To show the value in the label I’d use the ProgressChange
event (also it’s what you’d expect since it’s literally stated in a MS Docs example). During the function I`m doing this:
BackGroundWorker pass only a UserState but no ProgressPercentage (C#, Winforms)
Is there a way to do this? I found nothing about it. My progress needs to update some elements on the form during a loop but I don’t need actually any int value like progress percent. So it looks to me a slight waste of code needing to pass mandatorily a int value (even if it is a fixed 1 value, still it’s pointless to pass it).