Solved

Need to resize a form where Borderstyle = bsNone

Posted on 2006-11-01
7
1,168 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
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now