Difference between Resize and SizeChanged events

后端 未结 3 1297
北荒
北荒 2021-01-01 09:31

In C# .Net in Winforms, I found two events in almost all components, Resize() and SizeChanged(). Is there any difference between them? If both events are the same then why

3条回答
  •  误落风尘
    2021-01-01 09:45

    The Resize event occurs when the control is resized, while the SizeChanged event occurs when the Size property changes.

    You could use either, as a resize will cause the Size property to change. However, you should rather use the Layout event, as recommended both in the documentation for the Resize and SizeChanged events.

提交回复
热议问题