Closing a form during a constructor

前端 未结 9 2039
面向向阳花
面向向阳花 2020-12-01 11:59

Is it possible to close a form while the constructor is executing (or simply to stop it showing at this stage)?

I have the following code:

public par         


        
9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 12:06

    The only thing you could do it set a flag to close it in the constructor, and then closing it in the Shown event. Of course, if you're doing that, it makes sense to move the code to determine whether it should be closed there in the first place.

提交回复
热议问题