Windows form from console
问题 I would like to spawn a Windows form from the console using C#. Roughly like display does in Linux, and modify its contents, etc. Is that possible? 回答1: You should be able to add a reference for System.Windows.Forms and then be good to go. You may also have to apply the STAThreadAttribute to the entry point of your application. using System.Windows.Forms; class Program { [STAThread] static void Main(string[] args) { MessageBox.Show("hello"); } } ... more complex ... using System.Windows.Forms