Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OnResize vs OnSizeChanged

Tags:

c#

winforms

What is the difference between these two events? I can't think of any case where both wouldn't be called at the same time, and MSDN is less than enlightening.

like image 802
Dan Is Fiddling By Firelight Avatar asked Dec 21 '10 13:12

Dan Is Fiddling By Firelight


2 Answers

Answer from Bob Powell [MVP] found on internet (discussion goes further) :

Internally, OnSizeChanged calls OnResize so they are pretty tightly linked.

The OnResize method is responsible for invalidating the control if the ResizeRedraw style is set.

like image 79
LaGrandMere Avatar answered Oct 20 '22 16:10

LaGrandMere


AFAIK, the Resize-Event is fired if the actual size of the form changes. The SizeChanged-Event fires if the value of the Size-Property is updated.

like image 28
Bobby Avatar answered Oct 20 '22 17:10

Bobby