|
Reported by David Willis
To reproduce, check the value of the WindowState property in the FormReize
event when maximizing and restoring. The value is incorrect. Delphi 1.02 and
Delphi 3 give correct values. The attached code sample
updates a label on a form with the currect value. Try maximizing and restoring.
To fix this bug, you need to edit the FORMS.PAS file. I haven't attempted a
workaround that doesn't involve editing the VCL code, although I'm sure it
would be possible by trapping the WM_SIZE message.
You need to adjust the TCustomForm.WMSize procedure so that the "inherited"
line comes AFTER the case statement that sets the WindowState property.
i.e.:
procedure TCustomForm.WMSize(var Message: TWMSize);
begin
{inherited;} // remove this line
if not (csDesigning in ComponentState) then
case Message.SizeType of
SIZENORMAL: FWindowState := wsNormal;
SIZEICONIC: FWindowState := wsMinimized;
SIZEFULLSCREEN: FWindowState := wsMaximized;
end;
inherited; // move line to here.
RequestAlign;
......
I am using US English Delphi 4.0 Professional updated with the 12 August
1998 patch. |