1 line of code/500 points: Makeing form bigger than screen resolution

Hi ppl! All I need is a big form, like 3000x2000 pixel.

I don't care if therefore the desktop has to be changed to a virtual size (e.g. when you have two screens connected to your gfx card and one has a bigger resolution than the other one, the smaller screen will be scrolled whenever the mousecursor touches one of the screen eges - that would be just fine for me, except that I don't have/want two screens hooked up - just one)

Solution 2: Just resize the damn window. Calling SetWindowPos wont help. The window won't go beyond the size of the actual resolution. Please help!!


Cheers,
Jessi



BTW:
This does NOT work: http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20413260.html
At least not on Windows XP.

Keywords: Resize Resizing Res Window larger bigger above beyond
jessicasmithAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pcsentinelCommented:
Why cant you just place all your controls onto a scrollable form?
DavidBirch2dotComCommented:
a solution in kind may be that if you stick a panel onto the form & resize that, it will then stretch the form beyond the resolution.  Note that the panel should not be aligned to client or set to auto resize or this will not work.  (This will work at design time or runtime)
sas13Commented:
type
   TForm1 = class(TForm)
   ...
    procedure WMWindowPosChanging(var AMessage: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING;
    procedure WMGetMinMaxInfo(var AMessage : TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
    procedure Button1Click(Sender: TObject);
   ...
  end;

 
procedure TForm1.WMGetMinMaxInfo(var AMessage: TWMGetMinMaxInfo);
var
  _sz: TPoint;
begin
 _sz := Point(3000, 2000);
 with AMessage.MinMaxInfo^ do begin
  ptMaxSize := TPoint(_sz);
  ptMaxTrackSize := TPoint(_sz)
 end
end;

procedure TForm1.WMWindowPosChanging(var AMessage: TWMWindowPosChanging);
begin
 // not inherited
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
 SetBounds(0, 0, 3000, 2000);
end;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AFZDeveloperCommented:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
  private
    procedure WMGetMinMaxInfo(var uMessage : TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
  public
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.WMGetMinMaxInfo(var uMessage : TWMGetMinMaxInfo);
begin
  uMessage.MinMaxInfo^.ptMaxSize.X:=5000;
  uMessage.MinMaxInfo^.ptMaxSize.Y:=5000;
  uMessage.MinMaxInfo.ptMaxTrackSize:=uMessage.MinMaxInfo^.ptMaxSize;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Form1.Height:=2400;
  form1.Width:=3200;
end;

end.
jessicasmithAuthor Commented:
bingo! :D
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.