Winform启动时隐藏不显示

我最终用了这个方法:
1.MainForm的构造方法中添加:

public MainForm()
{
    InitializeComponent();

    this.ShowInTaskbar = false;
    this.Opacity = 0;
}

 

2.MainForm的Shown事件中添加:

private void MainForm_Shown(object sender, EventArgs e)
{
    this.Hide();

    this.ShowInTaskbar = true;
    this.Opacity = 1;
}
posted @ 2018-09-04 11:29  lehoho  阅读(1230)  评论(0编辑  收藏  举报