Form - ficar maximizado sobre toda a tela |
Top Previous Next |
Enlarge a Form Over Screen Size {Add a button to a form and try this:}
//Due to the default Windows handling of //the WM_GETMINMAXINFO message, //the max size of the form is set to //the screen size.
... private procedure WMGetMinMaxInfo (var msg: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; ...
implementation procedure TForm1.WMGetMinMaxInfo (var msg: TWMGetMinMaxInfo); begin inherited; with msg.MinMaxInfo^.ptMaxTrackSize do begin X := GetDeviceCaps(Canvas.Handle, HORZRES) + (Width - ClientWidth); Y := GetDeviceCaps(Canvas.Handle, VERTRES) + (Height - ClientHeight); end; end;
procedure TForm1.Button1Click(Sender: TObject); Const Rect: TRect = (Left:0; Top:0; Right:0; Bottom:0); begin if Left > 0 then begin Rect := BoundsRect; SetBounds( Left - ClientOrigin.X, Top - ClientOrigin.Y, GetDeviceCaps(Canvas.Handle, HORZRES) + (Width - ClientWidth), GetDeviceCaps(Canvas.Handle, VERTRES) + (Height - ClientHeight) ); end else BoundsRect := Rect; end;
|