Click here to Skip to main content
15,902,112 members
Home / Discussions / C#
   

C#

 
AnswerRe: Report Progress from a class with a backgroundWorker Pin
Luc Pattyn14-Feb-11 7:42
sitebuilderLuc Pattyn14-Feb-11 7:42 
GeneralRe: Report Progress from a class with a backgroundWorker Pin
MacRaider414-Feb-11 7:57
MacRaider414-Feb-11 7:57 
GeneralRe: Report Progress from a class with a backgroundWorker Pin
Luc Pattyn14-Feb-11 8:13
sitebuilderLuc Pattyn14-Feb-11 8:13 
GeneralRe: Report Progress from a class with a backgroundWorker Pin
MacRaider414-Feb-11 8:21
MacRaider414-Feb-11 8:21 
AnswerRe: Report Progress from a class with a backgroundWorker Pin
Ian Shlasko14-Feb-11 8:11
Ian Shlasko14-Feb-11 8:11 
GeneralRe: Report Progress from a class with a backgroundWorker Pin
MacRaider414-Feb-11 8:28
MacRaider414-Feb-11 8:28 
GeneralRe: Report Progress from a class with a backgroundWorker Pin
Ian Shlasko14-Feb-11 9:31
Ian Shlasko14-Feb-11 9:31 
GeneralRe: Report Progress from a class with a backgroundWorker Pin
MacRaider414-Feb-11 9:46
MacRaider414-Feb-11 9:46 
Ok I've been doing some more reading, would this be better using a "thread" vs a BGW? Now granted I don't need to put this in a seperate class, however for what ever reason when I use BGWs[0].RunWorkerAsync(); vs backgroundWorker1.RunWorkerAsync(); I'm not able to have the "function" in the same class (the Form) thus why I moved it to a seperate class. Plus when I was getting into more advanced someone reccomended keeping as little as you can on your main form and using classes for as much as possible. Is this a good habbit, bad habbit or just personal preference? Where I work there are two of us, and he does all the C++ stuff and I do the VB (6+ years, though .net in only the last year) and just starting with C# (about 6 months ago).

I have been able to subclass a BGW in VB but obviously not in C#, yet again if I don't have to not a big deal.

Basically what I need to do is be able to run the same function up to 3 times concurrently. I believe if my memory serves me correctally each "occurance" of the function will have it's own local variables. I also believe that if I use a thread vs a bgw I can lock what I'm writing to and instead of throwing a error, the threads will wait until the current one is done updating. Lets say it's just lblOutput.Text = e.UserState.ToString(); (as if it were a bgw perhaps in a thread you can use the variable directally)?

Does this help to explain what I'm trying to accomplish and maybe give you all a better idea of what path I should be taking?
GeneralRe: Report Progress from a class with a backgroundWorker Pin
Ian Shlasko14-Feb-11 12:11
Ian Shlasko14-Feb-11 12:11 
GeneralRe: Report Progress from a class with a backgroundWorker Pin
DaveyM6914-Feb-11 11:24
professionalDaveyM6914-Feb-11 11:24 
QuestionSet a picture transparently in the foreground Pin
Mschauder14-Feb-11 2:21
Mschauder14-Feb-11 2:21 
AnswerRe: Set a picture transparently in the foreground Pin
musefan14-Feb-11 3:03
musefan14-Feb-11 3:03 
GeneralRe: Set a picture transparently in the foreground Pin
Mschauder14-Feb-11 3:15
Mschauder14-Feb-11 3:15 
GeneralRe: Set a picture transparently in the foreground Pin
musefan14-Feb-11 3:42
musefan14-Feb-11 3:42 
GeneralRe: Set a picture transparently in the foreground Pin
Mschauder14-Feb-11 22:08
Mschauder14-Feb-11 22:08 
Questiondirectory path Pin
arkiboys13-Feb-11 22:12
arkiboys13-Feb-11 22:12 
AnswerRe: directory path Pin
Pete O'Hanlon13-Feb-11 22:17
mvePete O'Hanlon13-Feb-11 22:17 
GeneralRe: directory path Pin
arkiboys13-Feb-11 22:23
arkiboys13-Feb-11 22:23 
GeneralRe: directory path Pin
Pete O'Hanlon13-Feb-11 22:45
mvePete O'Hanlon13-Feb-11 22:45 
GeneralRe: directory path Pin
arkiboys13-Feb-11 23:22
arkiboys13-Feb-11 23:22 
AnswerRe: directory path Pin
Dalek Dave14-Feb-11 0:14
professionalDalek Dave14-Feb-11 0:14 
AnswerRe: directory path Pin
GenJerDan14-Feb-11 0:29
GenJerDan14-Feb-11 0:29 
GeneralRe: directory path Pin
Pete O'Hanlon14-Feb-11 0:34
mvePete O'Hanlon14-Feb-11 0:34 
AnswerRe: directory path Pin
Luc Pattyn14-Feb-11 1:01
sitebuilderLuc Pattyn14-Feb-11 1:01 
AnswerRe: directory path Pin
PIEBALDconsult14-Feb-11 2:00
mvePIEBALDconsult14-Feb-11 2:00 

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.