I am sure many developers are frustrated by the flickering when resize events happens faster than onPaint event.
I have created many user objects that is shown on the main form. When I try to set the location and size of each controls at the resize event of the main form, I get the flickering.
To resolve this I wanted to do a new approach as mentioned below.
- When resizeBegin event is triggered, show a borderline of current frame
- When resize event is triggered, only the borderline will be resized leaving the controls in the main frame untouched.
- The tricky part is when the borderline is larger than original size, I want it to show the background of the window as it self. Click for Enlarge image
- On the contrary if the borderline is smaller then, I still want the original objects to be shown Click for Reduce image
- When resizeEnd then the borderline will be hidden and the controls in the frame will be resized.
Does anybody know how to implement the tricky part mentioned at resize?