Click here to Skip to main content
15,913,487 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can I create an array or List of class properties? Pin
Member 9629-Mar-07 10:02
Member 9629-Mar-07 10:02 
AnswerRe: Can I create an array or List of class properties? Pin
led mike29-Mar-07 8:13
led mike29-Mar-07 8:13 
GeneralRe: Can I create an array or List of class properties? Pin
Member 9629-Mar-07 8:19
Member 9629-Mar-07 8:19 
GeneralRe: Can I create an array or List of class properties? Pin
led mike29-Mar-07 8:30
led mike29-Mar-07 8:30 
GeneralRe: Can I create an array or List of class properties? Pin
Member 9629-Mar-07 8:59
Member 9629-Mar-07 8:59 
AnswerRe: Can I create an array or List of class properties? Pin
Leslie Sanford29-Mar-07 10:41
Leslie Sanford29-Mar-07 10:41 
GeneralRe: Can I create an array or List of class properties? Pin
Member 9629-Mar-07 10:51
Member 9629-Mar-07 10:51 
QuestionQuick Question Pin
Ennis Ray Lynch, Jr.29-Mar-07 7:14
Ennis Ray Lynch, Jr.29-Mar-07 7:14 
AnswerRe: Quick Question Pin
kubben29-Mar-07 7:26
kubben29-Mar-07 7:26 
GeneralRe: Quick Question Pin
Ennis Ray Lynch, Jr.29-Mar-07 8:10
Ennis Ray Lynch, Jr.29-Mar-07 8:10 
GeneralRe: Quick Question Pin
kubben5-Apr-07 9:35
kubben5-Apr-07 9:35 
GeneralRe: Quick Question Pin
Vasudevan Deepak Kumar29-Mar-07 9:05
Vasudevan Deepak Kumar29-Mar-07 9:05 
AnswerRe: Quick Question Pin
Member 9629-Mar-07 7:40
Member 9629-Mar-07 7:40 
QuestionThreading Pin
HexaDeveloper29-Mar-07 6:02
HexaDeveloper29-Mar-07 6:02 
AnswerRe: Threading Pin
Not Active29-Mar-07 6:12
mentorNot Active29-Mar-07 6:12 
GeneralRe: Threading Pin
HexaDeveloper29-Mar-07 7:05
HexaDeveloper29-Mar-07 7:05 
AnswerRe: Threading Pin
Member 9629-Mar-07 7:42
Member 9629-Mar-07 7:42 
GeneralRe: Threading Pin
HexaDeveloper29-Mar-07 9:50
HexaDeveloper29-Mar-07 9:50 
GeneralRe: Threading Pin
Member 9629-Mar-07 10:01
Member 9629-Mar-07 10:01 
GeneralRe: Threading Pin
HexaDeveloper29-Mar-07 11:12
HexaDeveloper29-Mar-07 11:12 
GeneralRe: Threading Pin
Member 9629-Mar-07 11:28
Member 9629-Mar-07 11:28 
GeneralRe: Threading Pin
HexaDeveloper30-Mar-07 9:57
HexaDeveloper30-Mar-07 9:57 
GeneralRe: Threading Pin
Member 9630-Mar-07 10:54
Member 9630-Mar-07 10:54 
GeneralRe: Threading Pin
HexaDeveloper1-Apr-07 2:36
HexaDeveloper1-Apr-07 2:36 
GeneralRe: Threading Pin
Member 961-Apr-07 6:35
Member 961-Apr-07 6:35 
1) You don't have to use this with a progressbar, even if it's just a spinner cursor or a text box that get's updated but *somehow* you are reporting to the end user that something is still happening right? In one app I use a progress bar, but I also use a text box to report the stage of a multi stage operation and in the backgroundworkder ReportProgress method I put the string of text describing the state in the UserState object parameter. Then in my UI's progresschanged event I both update the progressbar and the text box with the UserState string.


Why do you need to call invalidate, you can just update whatever UI objects you are using to report progress in the reportprogress event. I can't think of any reason to call Invalidate.

If you don't want to report anything to the user and are just using the backgroundworkder to spawn a thread to do something behind the scenes there is no need to call reportprogress or handle the progresschanged event (though it's still useful in a non UI situation in case you want to detect if it's stalled for some reason even just in code)

2) I've never found a need to call Dispose on the backgroundworker object so I can't speak to that but the error seems to indicate, you are calling it too early.

A lot of what you seem to be having problems with sounds like it stems from your earlier attempts to manually create threads and doesn't apply to the backgroundworker method at all. It seems like you are overthinking this and putting too much extra code in that you don't actually need. Without knowing the exact details I can't say for sure, but that's what it sounds like.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.