C# Run application MINIMIZED at windows startup

后端 未结 5 1936
盖世英雄少女心
盖世英雄少女心 2020-12-10 08:59

I got the following code to run the application at windows startup:

    private void SetStartup(string AppName, bool enable)
    {
        string runKey = \"         


        
5条回答
  •  -上瘾入骨i
    2020-12-10 09:43

    Have you tried

    this.WindowState = FormWindowState.Minimized;
    

    If you want to start minimized at windows startup only you can add extra argument to command line, like myapp.exe --start-minimized, then you can parse this parameter and detect whether you need to start minimized or not.

提交回复
热议问题