Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need to resize a form where Borderstyle = bsNone

Posted on 2006-11-01
7
Medium Priority
?
1,257 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
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!

 
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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

721 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