Opening Windows Forms from Console Applicaition.

A

Anders Both

How do I open a form from a Console Application.

I can do it using Application.run or Form.Show(). But i does not really work
out for me.

I want to have a form, but i want the form and my Console part, to be
running in the same time, and beeing able to communicate.

This code will ilustrate my problem:

static void Main(string[] args)
{
clientForm f = new clientForm();
f.Show();
for (int i=0;i<30;i++)
{
f.statusTextBox.Text += i + ". ";
Console.WriteLine(i);
Thread.Sleep(100);
}
Application.Run(f);
for (int i=0;i<30;i++)
{
f.statusTextBox.Text += i + ". ";
Console.WriteLine(i);
Thread.Sleep(100);
}
 

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.

Ask a Question

Top