Hi Kevin,
Thanks for the link. This was a new concept for me. May I
know why you wanted to host another EXE within your application; just
curiosity and of course if you don't mind it.
Hello Kevin,
I also want to run an external application and show it in a windows .net
form. Unfortunally the link to codeproject doesn't work. Can you reply me the
article please or do you have an example for me ?
private void Startnewformthread()
{
frmMyform frm = new frmMyform();
frm.Show();
//here do a loop while the form exist, just be sure to put a
DoEvents
//and a certain pause timer to not make it run 100000 times per
second
//for sleep use this : System.Threading.Thread.Sleep(1000);
//1000 = 1 second
}
somewhere in the code
Thread t = new Thread(new ThreadStart(Startnewformthread));
t.Start();
private void Startnewformthread()
{
frmMyform frm = new frmMyform();
frm.Show();
//here do a loop while the form exist, just be sure to put a
DoEvents
//and a certain pause timer to not make it run 100000 times per
second
//for sleep use this : System.Threading.Thread.Sleep(1000);
//1000 = 1 second
}
somewhere in the code
Thread t = new Thread(new ThreadStart(Startnewformthread));
t.Start();
You shouldn't run your own message loop on a seperate thread. If you
want two or more independent message loops, use Application.Run(frm) on
the appropriate thread.
Also make sure to not access any control on another thread without an
appropriate call to Control.Invoke().
Best regards,
Martin
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.