Change Main in WPF project

前端 未结 2 1104
自闭症患者
自闭症患者 2021-01-15 20:23

Always annoyed me how C# wants to do the startup for you. So now I am trying to make my own main method. It\'s not working:

I have provided this main method:

2条回答
  •  广开言路
    2021-01-15 20:39

    Always annoyed me how C# wants to do the startup for you. So now I am trying to make my own main method. It's not working:

    C# doesn't do the startup for you. It inserts code that does it for you. You could always change the code and so whatever you wanted. First thing I would do if I were you - Right click the project file and select Properties. Under Application (the top tab) - see Startup Object.

    You can select the form

    Also - You're missing a line if you want the window to appear:

    window.Show();
    

提交回复
热议问题