dimanche 12 avril 2015

Show form on another thread after startup [on hold]

I am trying to open a form right on another thread right after the program starts to check for updates, but when I run this I get an error; an ObjectDisposedException.


Can anyone tell why this happens or how I can fix this?



[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

SplashScreen splash = new SplashScreen();

Thread updateThread = new Thread(new ThreadStart(openUpdateForm));
updateThread.Start();

splash.Show();
Application.Run();
}

public static void openUpdateForm()
{
UpdateForm uForm = new UpdateForm(false);
uForm.Show(); // <- ObjectDisposedException
}

Aucun commentaire:

Enregistrer un commentaire