So what IS the difference between the Resize and the SizeChanged events?
Believe it or not *absolutely* nothing. One method calls the other. However because the latter is named "Changed" it can be used for data binding - so while I dont have any concrete proof, that's my theory on why both exist.
However, if you are doing any real work in either of these handlers, you may want to consider using the Layout event instead. Also if you're just using this event to call Invalidate or Refresh (to repaint when the size of the control changes), consider using SetStyle(ControlStyles.ResizeRedraw, true);
Comments
- Anonymous
August 15, 2005
Had a confirmation from ChrisAn (Simplegeek) who was on the team at the time - the guess is right, binding was the reason it was added.
Thanks Chris! - Anonymous
June 23, 2006
Most of the time, you can get away with checking it in the Form.SizeChanged or Form.Resize...