Click here to Skip to main content
16,013,082 members
Home / Discussions / C#
   

C#

 
GeneralRe: Set MdiParent form BackgroundWorker Pin
ddecoy4-Feb-10 1:29
ddecoy4-Feb-10 1:29 
GeneralRe: Set MdiParent form BackgroundWorker Pin
ddecoy4-Feb-10 1:47
ddecoy4-Feb-10 1:47 
GeneralRe: Set MdiParent form BackgroundWorker Pin
Rob Philpott4-Feb-10 2:15
Rob Philpott4-Feb-10 2:15 
GeneralRe: Set MdiParent form BackgroundWorker Pin
ddecoy4-Feb-10 2:29
ddecoy4-Feb-10 2:29 
GeneralRe: Set MdiParent form BackgroundWorker Pin
ddecoy4-Feb-10 2:29
ddecoy4-Feb-10 2:29 
GeneralRe: Set MdiParent form BackgroundWorker Pin
Rob Philpott4-Feb-10 2:33
Rob Philpott4-Feb-10 2:33 
GeneralRe: Set MdiParent form BackgroundWorker Pin
ddecoy4-Feb-10 2:56
ddecoy4-Feb-10 2:56 
GeneralRe: Set MdiParent form BackgroundWorker Pin
Dave Kreskowiak4-Feb-10 3:37
mveDave Kreskowiak4-Feb-10 3:37 
Because you cannot do UI stuff, like creating forms and showing them, on anything other that the app's startup thread, also known as the UI thread.

I do NOT care that "it works for me!". You or, more importantly, your customers WILL eventually find a problem that only shows up under certain circumstances that you're not going to be able to duplicate and, if you do, will be very weird and nearly impossible to track down.

You just do NOT do it if you want your app to be as stable as possible.


You're going about this backwords. You do not keep the long-running work on the UI thread in your main form. You move THAT work to a background thread, freeing up the UI thread to handle putting up a "progress" form and updating it.

UI stuff stays on the UI thread. Actual work stuff goes on background threads.

Using an MdiParent form to do this is just silly.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




GeneralRe: Set MdiParent form BackgroundWorker Pin
ddecoy4-Feb-10 4:47
ddecoy4-Feb-10 4:47 
GeneralRe: Set MdiParent form BackgroundWorker Pin
Dave Kreskowiak4-Feb-10 12:41
mveDave Kreskowiak4-Feb-10 12:41 
QuestionHow i implement Strategy Design pattern in following case Pin
pekhaleyogesh3-Feb-10 23:26
pekhaleyogesh3-Feb-10 23:26 
AnswerRe: How i implement Strategy Design pattern in following case Pin
J4amieC3-Feb-10 23:58
J4amieC3-Feb-10 23:58 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 0:21
pekhaleyogesh4-Feb-10 0:21 
AnswerRe: How i implement Strategy Design pattern in following case Pin
Rob Philpott4-Feb-10 0:21
Rob Philpott4-Feb-10 0:21 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 0:25
pekhaleyogesh4-Feb-10 0:25 
AnswerRe: How i implement Strategy Design pattern in following case Pin
Not Active4-Feb-10 1:55
mentorNot Active4-Feb-10 1:55 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 2:21
pekhaleyogesh4-Feb-10 2:21 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 2:30
pekhaleyogesh4-Feb-10 2:30 
GeneralRe: How i implement Strategy Design pattern in following case Pin
Not Active4-Feb-10 2:41
mentorNot Active4-Feb-10 2:41 
Questiontying an event to dynamically created radio buttons [Solved] Pin
Wamuti3-Feb-10 22:38
Wamuti3-Feb-10 22:38 
AnswerRe: tying an event to dynamically created radio buttons Pin
Zar Ni3-Feb-10 22:57
Zar Ni3-Feb-10 22:57 
AnswerRe: tying an event to dynamically created radio buttons Pin
Luc Pattyn4-Feb-10 0:14
sitebuilderLuc Pattyn4-Feb-10 0:14 
Questioncreate LogError file(C# Coding) [modified] for WindowsApplication Pin
jojoba20103-Feb-10 22:06
jojoba20103-Feb-10 22:06 
AnswerRe: create LogError file(C# Coding) Pin
Zar Ni3-Feb-10 22:16
Zar Ni3-Feb-10 22:16 
QuestionRe: create LogError file(C# Coding) Pin
jojoba20103-Feb-10 22:38
jojoba20103-Feb-10 22:38 

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.