Hiding forms on startup: why doesn't this.Hide() hide my form?

前端 未结 6 1425
有刺的猬
有刺的猬 2020-12-10 02:58

I wanted to hide the main window of my app on startup, so I put this in the constructor:

this.Hide();

This doesn\'t hide my form though. It

6条回答
  •  既然无缘
    2020-12-10 03:22

    you can use this line of code. It wont hide it, but it will be minimized:

    this.WindowState = FormWindowState.Minimized;
    

    in addition, if you don't want it showing on the task bar either, you can add this line:

    this.ShowInTaskbar = false;
    

    But why do you create the form if you don't want it to be visible in the first place?

提交回复
热议问题