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

前端 未结 6 1454
有刺的猬
有刺的猬 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:34

    If you would rather use this.Hide or this.Show you can do this

    protected override void OnShown(EventArgs e)
    {
        base.OnShown(e);
        this.Hide();
    }
    

提交回复
热议问题