static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Thread thread = new Thread(new ThreadStart(Debug));
thread.Start();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
static void Debug()
{开发者_运维百科
Console.WriteLine(Console.ReadLine());
}
I have something like that. It launchs a console and a windows form. What I want to do is Hide or close the console application without terminating the whole application and show it later by pressing a button or something like that from form. How can I prevent the application from closing?
Can't we just fit up a console in windows form? My real problem is I'm writting an windows forms application. Also I want a window (console window) that will execute and test some functions on windows forms.
Something similar answered here: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/ea8b0fd5-a660-46f9-9dcb-d525cc22dcbd
Basically, seems like you need to call some windows API functions to show/hide the console.
精彩评论