M
Matthias Steinbart
Hi,
I'm looking for the easiest way to display a fully functional form in a
different thread. I've created a test app and it doesn't seem to work as
expected. From my MainForm, a button is clicked and the eventhandler starts
a new thread. The thread-function looks like this.
protected static void run() {
// create a new window
wndStateMachineMonitor wndMonitor = new wndStateMachineMonitor();
wndMonitor.Show();
wndMonitor.Invalidate();
while(getStopRequest() == false) {
// every now and then we'll check for some data an, if necessare update
the wndMonitor
// DoSomething(...);
Thread.Sleep(updateInterval);
wndMonitor.Invalidate();
}
// close down the window
wndMonitor.Close();
}
I think that all varialbles are pretty selfexplanatory. What am I missing
out?
I'm looking for the easiest way to display a fully functional form in a
different thread. I've created a test app and it doesn't seem to work as
expected. From my MainForm, a button is clicked and the eventhandler starts
a new thread. The thread-function looks like this.
protected static void run() {
// create a new window
wndStateMachineMonitor wndMonitor = new wndStateMachineMonitor();
wndMonitor.Show();
wndMonitor.Invalidate();
while(getStopRequest() == false) {
// every now and then we'll check for some data an, if necessare update
the wndMonitor
// DoSomething(...);
Thread.Sleep(updateInterval);
wndMonitor.Invalidate();
}
// close down the window
wndMonitor.Close();
}
I think that all varialbles are pretty selfexplanatory. What am I missing
out?