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);
}
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);
}