Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1283
  • Last Modified:

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.
0
PAG_Promax
Asked:
PAG_Promax
1 Solution
 
sun4sundayCommented:
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
0
 
PAG_PromaxAuthor Commented:
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
0
 
calinutzCommented:
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
calinutzCommented:
>> 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;
0
 
Mihai StancescuSoftware Engineer Commented:
You can try this:

procedure TForm1.CreateParams(var Params: TCreateParams) ;
begin
  BorderStyle := bsNone;

  inherited;

  Params.ExStyle := Params.ExStyle or WS_EX_STATICEDGE;
  Params.Style := Params.Style or WS_SIZEBOX;
end;

Regards,
Mishu
0
 
PAG_PromaxAuthor Commented:
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
0
 
PAG_PromaxAuthor Commented:
Thanks for that, Mishu!  That worked fine.

Cheers,

Pag
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now