Im trying to launch a dialog by invoking several methods from a windows forms assembly. My app is a console app. All the execution logic goes well and without exceptions, but the window is not launched. Is it a known issue that you cant launch a windows form from a console app?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
well, yes. You have to have a Windows message loop for this to work.
If you create a Forms application from scratch, you'll see the Program.cs module created with ... Application.Run(new YourMainForm())
in it. Run is basically the message pump - having that is pretty much a requirement for forms to work.