Click here to Skip to main content
15,910,980 members
Home / Discussions / C#
   

C#

 
GeneralRe: Update/Refresh Form Pin
Anthony Mushrow15-Apr-08 7:07
professionalAnthony Mushrow15-Apr-08 7:07 
GeneralRe: Update/Refresh Form Pin
Waleed Eissa15-Apr-08 20:44
Waleed Eissa15-Apr-08 20:44 
GeneralShowDialog from seperate thread Pin
lgelliott15-Apr-08 5:06
lgelliott15-Apr-08 5:06 
GeneralRe: ShowDialog from seperate thread Pin
Judah Gabriel Himango15-Apr-08 6:19
sponsorJudah Gabriel Himango15-Apr-08 6:19 
GeneralRe: ShowDialog from seperate thread Pin
lgelliott15-Apr-08 7:44
lgelliott15-Apr-08 7:44 
GeneralRe: ShowDialog from seperate thread Pin
Judah Gabriel Himango15-Apr-08 10:02
sponsorJudah Gabriel Himango15-Apr-08 10:02 
GeneralRe: ShowDialog from seperate thread Pin
lgelliott15-Apr-08 10:34
lgelliott15-Apr-08 10:34 
GeneralRe: ShowDialog from seperate thread Pin
Judah Gabriel Himango15-Apr-08 11:37
sponsorJudah Gabriel Himango15-Apr-08 11:37 
I think the problem is that you're essentially modifying your main form on a background thread by making it become the owner of a form created on a different thread. This is bound to cause issues.

I guess what I'm saying is, there may not be a way to assign one form to be the owner of another when they're created on different threads. I think that's "illegal" by Win32 UI standards. I could be wrong about that, but I've never seen it done.

There are some alternatives that come to mind, both involve no threads:
  • Forcibly update the main form's progress bar during the initialization of the second form. This involves sprinkling mainForm.ProgressBar.Update() calls during the creation and showing of the second form.
  • Don't make the showing of the secondary form take so long: don't do any work during initialization, lazily initialize everything you can, wait for Application.Idle event to do anything, etc.
I guess both of those boil down to: find out what's taking long when showing the 2nd form, then spread out that work so it doesn't freeze your main form.








GeneralRe: ShowDialog from seperate thread Pin
lgelliott15-Apr-08 14:15
lgelliott15-Apr-08 14:15 
GeneralRe: ShowDialog from seperate thread Pin
lgelliott15-Apr-08 15:10
lgelliott15-Apr-08 15:10 
GeneralRe: ShowDialog from seperate thread Pin
Judah Gabriel Himango16-Apr-08 4:13
sponsorJudah Gabriel Himango16-Apr-08 4:13 
GeneralRe: ShowDialog from seperate thread Pin
lgelliott17-Apr-08 2:48
lgelliott17-Apr-08 2:48 
GeneralRe: ShowDialog from seperate thread Pin
Judah Gabriel Himango17-Apr-08 4:46
sponsorJudah Gabriel Himango17-Apr-08 4:46 
GeneralRe: ShowDialog from seperate thread Pin
lgelliott17-Apr-08 7:18
lgelliott17-Apr-08 7:18 
Generaldispose wrapped resource Pin
George_George15-Apr-08 4:46
George_George15-Apr-08 4:46 
GeneralRe: dispose wrapped resource Pin
Simon P Stevens15-Apr-08 5:03
Simon P Stevens15-Apr-08 5:03 
GeneralRe: dispose wrapped resource Pin
George_George15-Apr-08 5:07
George_George15-Apr-08 5:07 
GeneralRe: dispose wrapped resource Pin
Simon P Stevens15-Apr-08 7:34
Simon P Stevens15-Apr-08 7:34 
GeneralRe: dispose wrapped resource Pin
George_George15-Apr-08 23:25
George_George15-Apr-08 23:25 
GeneralRe: dispose wrapped resource Pin
Simon P Stevens16-Apr-08 1:21
Simon P Stevens16-Apr-08 1:21 
GeneralRe: dispose wrapped resource Pin
George_George16-Apr-08 1:55
George_George16-Apr-08 1:55 
GeneralRe: dispose wrapped resource Pin
Simon P Stevens16-Apr-08 4:18
Simon P Stevens16-Apr-08 4:18 
GeneralRe: dispose wrapped resource Pin
George_George16-Apr-08 4:23
George_George16-Apr-08 4:23 
GeneralRe: dispose wrapped resource Pin
led mike15-Apr-08 5:13
led mike15-Apr-08 5:13 
GeneralRe: dispose wrapped resource [modified] Pin
Simon P Stevens15-Apr-08 7:09
Simon P Stevens15-Apr-08 7:09 

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.