Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't open a form with scatterGraph on it in a thread that is not the main thread

I've created a form with a scatterGraph on it. I'm trying to show the form in a thread that isn't the main thread.
I receive an exception "InvalidCastException" when my program performs .ShowDialog() method of the form.
The code looks like in the example below:
 
...
ThreadStart ts = new ThreadStart(tsm);
Thread t = new Thread(ts);
t.Start();
...
private void tsm()
{
 
0 Kudos
Message 1 of 2
(3,115 Views)
Duplicate post
Jonathan N.
National Instruments
0 Kudos
Message 2 of 2
(3,097 Views)