1

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.

  1. When resizeBegin event is triggered, show a borderline of current frame
  2. 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
  3. 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?

Eric J.
  • 147,927
  • 63
  • 340
  • 553
Ham Dong Kyun
  • 756
  • 4
  • 28
  • Which UI technology are you talking about? – Eric J. Jan 11 '13 at 01:53
  • JABFreeware, thank you for the comment. Added the question at the end. – Ham Dong Kyun Jan 11 '13 at 01:54
  • Eric J. What do you mean by which UI? I am just using System.Windows.Forms UIs and System.Drawing UIs. Does that answer your questions? – Ham Dong Kyun Jan 11 '13 at 01:55
  • Do want to just hide all the controls? – FrostyFire Jan 11 '13 at 01:56
  • @JABFreeware, No. I want the controls to be as it is and visible. (Not hidden due to the reduced frame). – Ham Dong Kyun Jan 11 '13 at 01:58
  • In the old days of unmanaged code with VB6 & etc you needed to handle resizing controls. These days with .Net everyone uses Anchoring and Docking - suggest you test this out as it should overcome the flickering? – Jeremy Thompson Jan 11 '13 at 02:43
  • Not an answer to your exact question but you can stop flickering quite easily, see one of my old answers here: http://stackoverflow.com/a/13999980/1909055 – Mitch Jan 11 '13 at 04:40
  • @Jeremy Thompson, Thank you for the comment. Unfortunetly, there are some controls that overlaps. This makes it difficult to use anchoring and docking. – Ham Dong Kyun Jan 11 '13 at 06:30
  • @MitchTWC, This was close to what I was looking for, but unfortunetly, it does not takes care of the paint events of controls in the form. Thank you anyway. – Ham Dong Kyun Jan 11 '13 at 06:31

0 Answers0