G
Guest
Hi! I need to call a method with some parameters
on a form which was created on a different thread.
Here's how I create the form:
// Main Thread:
ThreadStart entryPoint = new ThreadStart(ShowSplashForm);
Thread splashFormThread = new Thread(entryPoint);
splashFormThread.Name = "Splash form thread";
splashFormThread.Start();
...................
public static frmSplash m_SplashForm;
public static void ShowSplashForm()
{
m_SplashForm = new frmSplash();
m_SplashForm.ShowDialog();
}
I can see that the form does get created on a new thread called "Splash form
thread"
Now the problem:
The frmSplash form has a public method called
UpdateCaption(string newCaption)
How do I call it from the main thread that created this form ?
is it possible ? Any ideas/examples are highly appreciated.
on a form which was created on a different thread.
Here's how I create the form:
// Main Thread:
ThreadStart entryPoint = new ThreadStart(ShowSplashForm);
Thread splashFormThread = new Thread(entryPoint);
splashFormThread.Name = "Splash form thread";
splashFormThread.Start();
...................
public static frmSplash m_SplashForm;
public static void ShowSplashForm()
{
m_SplashForm = new frmSplash();
m_SplashForm.ShowDialog();
}
I can see that the form does get created on a new thread called "Splash form
thread"
Now the problem:
The frmSplash form has a public method called
UpdateCaption(string newCaption)
How do I call it from the main thread that created this form ?
is it possible ? Any ideas/examples are highly appreciated.