开发者

Which executes first? Form_Load event or the initialization of components? (C# windows form)

Which executes first? Form_Load event or the initialization of comp开发者_JAVA技巧onents? (C# windows form)


Components will be initialized before form load.

See this article about form event order.


All the components of a Form are inialized first, then the Form is loaded


The initialization of component is happened in constructor (Designer automatically insert initializecomponent in constructor) while the form_load event fired when the form is displayed first time.


If you mean InitializeComponent() method, then it executes first from constructor. If you subscribe for Form_Load event from designer subscription code will be added to InitializeComponent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜