I need to display a window in an application, but it is console.
I've tried using:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
The code stayed like this.
static void Main(string[] args)
{
_handler += new EventHandler(Handler);
SetConsoleCtrlHandler(_handler, true);
ConnectToServer();
RequestLoop();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
But the window does not open, if I put the code first the window opens, but the console does not execute the command.
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
_handler += new EventHandler(Handler);
SetConsoleCtrlHandler(_handler, true);
ConnectToServer();
RequestLoop();
}
Neither of the two codes works.
In the first code the window does not open.
In second code the window is opened, but the console does not execute the commands