Windows – Delphi 7 forms, anchors not working in Vista

64-bitanchordelphiformswindows

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.

Best Answer

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

Related Topic