Hi,
I have a window, where for a certain event(button click), I am
starting a new thread. This thread is retrieving data, creating a new
window and displaying it.

The window is being shown by "name.Show();". As the window is being
opened, it is being closed immediately. I know that I can use the
ShowDialog() method, but that would block the execution of the other
thread till the other terminates.

****event****
Thread x = new Thread(new ThreadStart(myMethod));
x.Start();

myMethod()
{
.... Doing some execution

messageWindow.Show();

.... I would like this to contine to live until window is closed,
.... and the other window(main) to contine operate on its own.
}


Can someone help me out.
Thanks in Advance

Re: Non-modal dialog by Adrian

Adrian
Fri Mar 11 03:35:22 CST 2005

Hi!
Try to create the method myMethod in the class form which you want to dispay
as modal like below:
using (MessageWindow messageWindow = new MessageWindow())
{
...
Thread x = new Thread(new ThreadStart(messageWindow.myMethod));
messageWindow.ShowDialog();
...
}

I'm not sure that is what you want.
Best regards.



Re: Non-modal dialog by Saurabh

Saurabh
Fri Mar 11 10:11:53 CST 2005

If your thread is a worker thread then shouldn't it just work? and then once
it has gathered the information, it should notify your main window and the
main window should show the other window (modelessly)

"Xarky" <bernardpace@yahoo.com> wrote in message
news:bc42e1a.0503102309.5fdf614c@posting.google.com...
> Hi,
> I have a window, where for a certain event(button click), I am
> starting a new thread. This thread is retrieving data, creating a new
> window and displaying it.
>
> The window is being shown by "name.Show();". As the window is being
> opened, it is being closed immediately. I know that I can use the
> ShowDialog() method, but that would block the execution of the other
> thread till the other terminates.
>
> ****event****
> Thread x = new Thread(new ThreadStart(myMethod));
> x.Start();
>
> myMethod()
> {
> .... Doing some execution
>
> messageWindow.Show();
>
> .... I would like this to contine to live until window is closed,
> .... and the other window(main) to contine operate on its own.
> }
>
>
> Can someone help me out.
> Thanks in Advance