Jerry,
All Form access must be done from the main UI thread. That includes
creating, manipulating, and showing the Form. You'll need a reference
to an existing Form or Control that your worker thread will use to
marshal the execution of a delegate onto the UI thread by calling
Invoke or BeginInvoke. That delegate should contain the code to create
and show the new Form. Invoke and BeginInvoke are among the very few
members of a Form or Control that are actually thread-safe.
Brian
Jerry Spence1 wrote:
I have the following which generates MDI forms, but doesn't show them at
this stage:
For n As Integer = 1 To 10
fmViewer(n) = New frmViewer
fmViewer(n).Tag = n
fmViewer(n).MdiParent = Frm1
Next
From within a new thread I wish to show a form:
fmViewer(4).show
However, it doesn't show. The answer I am sure is because I am trying to
show it from within a thread. How can I achieve this?
-Jerry