Posted By: raptor3676 | Jul 17th, 2006 @ 8:14 PM
page 1 of 1
Comments: 3 | Views: 2841
Hi everybody

Is it posible for an Windows Forms application to generate output throught out the console? I've tried using Console.Write without success.

I'm developing a WinForm application, and it has command line parameters one of them triggers a task and there is only need to show how many registers it process.  So no complex UI required.  I've seen Win32 doing this, How can I do that with .NET 2.0?

Atte,
Raptor

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

[DllImport("kernel32")]

private extern static bool AllocConsole();

private void Form1_Load(object sender, EventArgs e)

{

AllocConsole();

Console.Title = "Hello Title";

Console.WriteLine("Hello2");

}

}

If you just want to bring up a message winow just do

System.Windows.Forms.MessageBox(string);

page 1 of 1
Comments: 3 | Views: 2841