Solved

Need to resize a form where Borderstyle = bsNone

Posted on 2006-11-01
7
1,210 Views
Last Modified: 2008-01-09
Hi there,

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

Thanks!

Pag.
0
Comment
Question by:PAG_Promax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 9

Expert Comment

by:sun4sunday
ID: 17855914
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
 

Author Comment

by:PAG_Promax
ID: 17855960
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
 
LVL 11

Expert Comment

by:calinutz
ID: 17856154
0
Independent Software Vendors: 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!

 
LVL 11

Expert Comment

by:calinutz
ID: 17856164
>> 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
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 100 total points
ID: 17856817
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
 

Author Comment

by:PAG_Promax
ID: 17862868
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
 

Author Comment

by:PAG_Promax
ID: 17862903
Thanks for that, Mishu!  That worked fine.

Cheers,

Pag
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question