Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: Right aligned panel flickers upon resizing form

it should be simple but I don't find how to do it.

I create a form with a right aligned panel that I color in blue for example.

If I grab my forms left edge and resize it back and forth horizontally quickly, I would like the right panel not to move or flicker. As its position is unchanged, there is no reason why it should not stay completely steady. Does anybody know a simple trick to solve this apparently simple problem?

Thanks

like image 455
Emmanuel Ichbiah Avatar asked Jan 26 '12 19:01

Emmanuel Ichbiah


1 Answers

This is just a fact of life with Windows GUI apps. You can see the same effect in a WinForms app and indeed even in mainstream Windows apps. For example, open an Explorer window and do exactly the same operation, resize by grabbing the left hand edge of the window. You will see exactly the same effect. You can see the same effect by resizing from any edge. Word and Excel behave in the same way.

My guess is that Windows repaints in the sizing loop before it sends the resizing message that allows the app to realign its controls.

like image 175
David Heffernan Avatar answered Oct 16 '22 03:10

David Heffernan