C#/.NET - WinForms - Instantiate a Form without showing it

前端 未结 18 1779
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 18:29

I am changing the Visibility of a Form to false during the load event AND the form still shows itself. What is the right event to tie this.Visible = false; to? I\'d like to

18条回答
  •  南笙
    南笙 (楼主)
    2020-12-05 18:44

    If this is your main form, there may not be a better place then the Shown event. But in that case you will get flicker.

    I couldn't find a good place to stop a running main form from showing at least quickly. Even a timer activated in the load event won't do it.

    If it is a secondary form just create it but don't show it.

提交回复
热议问题