window appears when thread is done

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

Hello,

I have an application with several windows forms. On form A, I run a
thread. Meanwhile, another windows form, say B, is opened. But when the
thread, started from form A is finished, form A appears on top of form B.

Does anyone knows a method or setting to prevent form A from being
placed on top of B when the thread is finished?

Thanks,

Steven
 
* Steven said:
I have an application with several windows forms. On form A, I run a
thread. Meanwhile, another windows form, say B, is opened. But when
the thread, started from form A is finished, form A appears on top of
form B.

Are you sure you never access the controls/forms from the other thread?
Are you creating the 2nd form inside the other thread? Notice that
Windows Forms controls' instance members are not safe for
multithreading.

If you are not accessing the controls/forms from the thread <> the UI
thread, you may want to call the form's 'Activate' method.
 
Back
Top