Link to home
Start Free TrialLog in
Avatar of PAG_Promax
PAG_Promax

asked on

Need to resize a form where Borderstyle = bsNone

Hi there,

Can anyone tell me how I can resize a form when the BorderStyle = bsNone ?

Thanks!

Pag.
Avatar of sun4sunday
sun4sunday
Flag of India image

It is possible control it through the code
eg: place under on click event of a button to test

  BorderStyle := bsNone;
  Form1.Width := 300;
  Form1.Height := 300;

When the   BorderStyle := bsNone then the form will not have any borders and has to controll through some actions

sun4sunday
Avatar of PAG_Promax
PAG_Promax

ASKER

Hi sun4sunday,

I'm not sure what you mean?  I need to be able to resize the form just like you can when the BorderStyle := bsSingle.  I need to grab it at runtime and move it around.

Cheers,

Pag
>> I need to grab it at runtime and move it around.<< This means moving the form ... not resizing...

For moving the form without using the captionbar place this in the form onmousedown event:

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
Perform(WM_SYSCOMMAND, SC_MOVE + 1, 0);
end;
ASKER CERTIFIED SOLUTION
Avatar of Mihai Stancescu
Mihai Stancescu
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys, I don't have a problem with moving the form.  That functionality works fine.  Resizing is what Im talking about.

Will try Mishu's suggestion now.

Cheers,

Pag
Thanks for that, Mishu!  That worked fine.

Cheers,

Pag