.NET C# main method and windows forms -


i have visual studio project uses c# , console application. when try run/build/debug project look's main method in existing class. have added windows form on project , want run in windows form version , not in command line (expecting arguments). can tell me how edit run time of project windows forms instead of static void main()?

method 1

in main function use following:

application.run(new form1()); 

you need add following line @ top of file:

using system.windows.forms; 


method 2

in main function, add this:

form1 c = new form1(); c.showdialog(); 


both methods show form dialog. console still visible in background however.

if want hide console window following link gives instructions (but it's little convoluted):

http://social.msdn.microsoft.com/forums/vstudio/en-us/ea8b0fd5-a660-46f9-9dcb-d525cc22dcbd/hide-console-window-in-c-console-application


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -