Load vs. Shown events in Windows Forms

后端 未结 6 724
难免孤独
难免孤独 2020-12-25 11:13

Hopefully I\'m just missing something obvious, but I\'m trying to get my head around the differences between the Load and the Shown events in Windows Forms.

Traditio

6条回答
  •  鱼传尺愫
    2020-12-25 11:42

    The Shown event occurs after the Load event. The main difference is not in the visibility of the form but in its state (width, height, etc.).

    To clarify, here is an example. Consider a form that has a default size of 100, 200 and a WindowState that is Maximized. In the Load event handler, the size will be 100, 200. But in the Shown event handler, the size will be your screen size.

提交回复
热议问题