The software is built on Delphi 7.
On my XP machine, the form resizes as I expect. However, on two Vista machines, I have components with anchors set to [akLeft, akTop, akRight, akBottom], but when I resize the form, the components don't stretch with the form, leaving blank spaces on the right and bottom edge. On the XP machine, the components correctly stretch with the form.
So, it seems like the Vista machine is ignoring the anchor property. Any ideas what's causing this and how to fix it?
Important update (François):
We had the same problem with our D2007 application and on all x64 windows.
Andreas' answer was indeed the fix.
So it is not D7 nor Vista related.
Maybe it is related to the "Windows Kernel stack overflow" problem that occurs if your control has many parents. And if you run it on a 64 bit system the kernel stack overflow happens much faster. (more about this here: http://news.jrsoftware.org/news/toolbar2000/msg07779.html)
On Embarcadero's CodeCentral is a workaround for this bug (which is also copied almost 1:1 into the Delphi 2009 VCL): http://cc.embarcadero.com/Item/25646
It might be because of the transparent frame which is shown by Vista. (In order to give different windows same transparent appearance.
Try using "Align" (alClient) instead of anchors. Since you are using all anchors, that makes more sense.
Before anchors were introduced in Delphi 4, we resized components dynamically to achieve the same effect. You can easily move/adjust the components in the form's onresize
event.
Setting the form's doublebuffered
property to true
may reduce flicker, by buffering the paint
method. I recall we used to have to implement that ourselves, too!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With