I’m looking for a way to check during a resizing event whether the control is currently being resized or whether it has reached its final size. (C# Windows Forms)
E.g. In Java with sliders, you can tell whether the user is currently sliding or whether they have released the mouse – this means that you can avoid expensive redraws or other calculations until the final value has been chosen.
Thanks in advance for any info.
The Form has a few events to help you with this
There’s the ResizeBegin, Resize, and ResizeEnd Events. A combination of them should get you what you want.
Further notes:
When you click and drag the border of a window, the event sequence is ResizeBegin, repeated Resize for each move of the mouse, ResizeEnd. When you minimize, maximize or restore the window size, then Resize is called once for each of those. A ResizeBegin and ResizeEnd pair is also called for simply moving the window around as well by the title bar, though not when you programatically set the windows Location property.