System button (close)

Hi.

I would like to make the system close button (x) appear out of the title bar...
Somewhere inside the form so i dont have to use the title bar at all. (BorderStyle--->bsNone).
Is that possible without a component ?

Thanks in advance.
LVL 16
CodedKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mikelittlewoodCommented:
This is an integrated part of the title bar so no. You would have to use your own component, say a speed button if you wanted it to look similar.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CodedKAuthor Commented:
I've found this components :

http://www.soft-gems.net/ThemeManager.php
http://www.soft-gems.net/supplement/download.php?ID=46

There is a demo exe that can make the system button appear outside of the titlebar...
0
mikelittlewoodCommented:
Note that this one will only work with XP as it is theme based
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

CodedKAuthor Commented:
:/ I dont want to use it though i justwanted to know if there is something i could do to force
the close button appear somewhere else...
0
tobjectpascalCommented:
Other than...

procedure TForm1.Button1Click(Sender: TObject);
begin
  Close;
end;

If you simply don't want the person using the X in the top right, you could disable it.

var
  Form1: TForm1;
  CanExit: Boolean;

Then onCreate (of the form)


procedure TForm1.FormCreate(Sender: TObject);
begin
 CanExit:=False;
end;


Then click on the Form > Events

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
 CanClose:=CanExit;
end;


Then one more thing to add :)

Click on your button

procedure TForm1.Button1Click(Sender: TObject);
begin
  CanExit:=True;
  Close;
end;

or make your own close routine.

Procedure MyClose;
Begin
  CanExit:=True;
  Form.Close; //whatever your main form is?
End;
0
CodedKAuthor Commented:
Thank tobjectpascal  but i know all that stuff i was just wondering
if i can move out of the tilte bar the system button :)

Thanks anyway.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.