this one should work.
using System.Runtime.InteropServices;
private void Form1_Load(object sender, EventArgs e)
{
AllocConsole();
}
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool AllocConsole();
More Related Contents:
- how to run a winform from console application?
- How to receive Plug & Play device notifications without a windows form
- read text file chunks by chunks by scrollbar [closed]
- Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on
- Communicate between two windows forms in C#
- How to stop BackgroundWorker on Form’s Closing event?
- Get a Windows Forms control by name in C#
- Databinding to List – See changes of data source in ListBox, ComboBox
- mail sending with network credential as true in windows form not working
- Best practice to make a multi language application in C#/WinForms? [closed]
- How do I set the selected item in a comboBox to match my string using C#?
- Combining multiple Attributes to a single Attribute – Merge Attributes
- Enable Entity Framework 6 for MySql (C#) in WinForms of Microsoft Visual Studio 2013
- How do I group Windows Form radio buttons?
- DateTimePicker: pick both date and time
- How should you diagnose the error SEHException – External component has thrown an exception
- C# console application icon
- How to add buttons dynamically to my form?
- How to convert an image to an icon without losing transparency?
- How to add a line to a multiline TextBox?
- WinForms Layered Controls with Background images cause tearing while scrolling
- How to navigate a few folders up?
- DataGridView AutoFit and Fill
- Determine Label Size based upon amount of text and font size in Winforms/C#
- How to inject CSS in WebBrowser control?
- How do I rotate a label in C#? [duplicate]
- Catch Textbox Scroll Event?
- RichTextBox Newline Conversion?
- Winform form closed event
- ASP.NET Core configuration for .NET Core console application