Hi,
On my Win Form App, I'm starting a new thread for my Splash Screen (and when loading some component on my main form).
I wanna be able to update a label on the new thread. I try with invoke, delegate and similar thing but i'm not able to do it.
I'm now out of ressource. Can anyone help me with this ? May be my code is not the best to do this ?
My frmSplashScreen form containt 1 label named metroLabel4 and this it this one I wanna update from the "// Code for loading component go here" section.
Thanks in advance.
On my Win Form App, I'm starting a new thread for my Splash Screen (and when loading some component on my main form).
I wanna be able to update a label on the new thread. I try with invoke, delegate and similar thing but i'm not able to do it.
I'm now out of ressource. Can anyone help me with this ? May be my code is not the best to do this ?
My frmSplashScreen form containt 1 label named metroLabel4 and this it this one I wanna update from the "// Code for loading component go here" section.
Thanks in advance.
C#:
public frmMain()
{
Thread t = new Thread(new ThreadStart(Loading)); // Starting thread
t.Start();
InitializeComponent();
// Code for loading component go here
t.Abort();//Complete
}
//Start splash screen
void Loading()
{
frmSplashScreen frm = new frmSplashScreen();
Application.Run(frm);
}
Last edited: