D
Devicharan
I have two forms, a Main Form and a Child Form.
And In the Main Form, I have a small Async Process, Which
needs to show the child form.
I use mainForm.BeginInvoke(ShowtheNewForm) to
start the async process and in the funciton
(ShowtheNewFOrm) I say ChildForm.Show().
I cannot use ShowDialog here as this blocks the
main form. I want control to be active on the MainForm
also. SO, this requires a Show().
Now the problem is, at time, the Child Form goes
behind the main form. To avoid this, I want to set main
form as Parent to the child form.
As we do in C++ when creating the form, I want to
set the parent. [CreateWindow(Parenthandle)].
Is there a way to do this in C#. When I use
childForm.Parent = mainForm; it gives a Run Time
exception as both of them are top level controls.
And In the Main Form, I have a small Async Process, Which
needs to show the child form.
I use mainForm.BeginInvoke(ShowtheNewForm) to
start the async process and in the funciton
(ShowtheNewFOrm) I say ChildForm.Show().
I cannot use ShowDialog here as this blocks the
main form. I want control to be active on the MainForm
also. SO, this requires a Show().
Now the problem is, at time, the Child Form goes
behind the main form. To avoid this, I want to set main
form as Parent to the child form.
As we do in C++ when creating the form, I want to
set the parent. [CreateWindow(Parenthandle)].
Is there a way to do this in C#. When I use
childForm.Parent = mainForm; it gives a Run Time
exception as both of them are top level controls.