Calling a method with params on a form on a different thread (C#)
Posted on 2004-10-14
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:
// In the Main Thread:
ThreadStart entryPoint = new ThreadStart(ShowSplashForm);
Thread splashFormThread = new Thread(entryPoint);
splashFormThread.Name = "Splash form thread";
public static frmSplash m_SplashForm;
public static void ShowSplashForm()
m_SplashForm = new frmSplash();
I can see that the form does get created on a new thread called "Splash form
Now the problem:
The frmSplash form has a public method called
public void UpdateCaption(string newCaption)
How do I call it from the main thread that created this form ?
Please provide the code for this example, not a link to google. I tried searching and examples I found either did not work or were not what I was looking for.
Many Thanks in Advance,