I have received a Fatal Error

Asked By 0 points N/A Posted on -
qa-featured

Hi Experts,

I have received a Fatal Error

Cross-thread operation not valid: Control ‘Splash’ accessed from a thread other than the thread it was created on.

Can I get a remedy of this error?

Do you have any idea about this error message?

Please help me.

SHARE
Best Answer by Bankk benediict
Answered By 10 points N/A #135412

I have received a Fatal Error

qa-featured

Hello James,

Note that you cannot be able to access the user interface elements from a thread other than the one that created them. You can go ahead and use Control.Invoke in order to access the user interface elements from other threads.

Also try declaring a DisposeDelegate in MyApplication: Private Delegate Sub DisposeDelegate()

Regards,

Carl

 

 

Best Answer
Best Answer
Answered By 0 points N/A #135413

I have received a Fatal Error

qa-featured

Based on my understanding, you want to find some other methods which may work like invoke method, don't you
In my point of view, there is no such methods exist except "invoke".
However, you don't need to call them on each control.
You can use one delegate and some parameters to do that, only "this.Invoke" is needed here.

Answered By 0 points N/A #135414

I have received a Fatal Error

qa-featured

 

Hello James Mayer,

Unfortunately, one cannot access User elements from the threads other than that which have created them. You can use Control Invoke to access user interface elements from other external threads. This code might also be helpful,

mySplashScreen.Invoke(new MethodInvoker(delegate {

    mySplashScreen.Close();

    mySplashScreen.Dispose();

}));

 

Hopefully this will be helpful.Good luck with your program.

Related Questions