B
babylon
I have a Form form1
i created another thread in from1
the thread will listen for a network packet from a server
if the thread receive the packet
i would like to open a modal dialog that will block all the user input to
the form1
i tried the following:
public class Form1 : System.Windows.Forms.Form
{
static Form1 p = null;
public Form1()
{
p = this;
InitializeComponent();
Thread t = new Thread(new ThreadStart(thread));
t.Start();
}
public static void thread()
{
Thread.Sleep(1000); // wait until a network packet comes....
Form c = new Form();
c.ShowDialog(p);
}
}
....it didn't work....the user still able to play with form1...
any idea?
thx!
i created another thread in from1
the thread will listen for a network packet from a server
if the thread receive the packet
i would like to open a modal dialog that will block all the user input to
the form1
i tried the following:
public class Form1 : System.Windows.Forms.Form
{
static Form1 p = null;
public Form1()
{
p = this;
InitializeComponent();
Thread t = new Thread(new ThreadStart(thread));
t.Start();
}
public static void thread()
{
Thread.Sleep(1000); // wait until a network packet comes....
Form c = new Form();
c.ShowDialog(p);
}
}
....it didn't work....the user still able to play with form1...
any idea?
thx!