Solved

align forms

Posted on 2008-10-25
6
336 Views
Last Modified: 2012-05-05
i need to align two forms so that the top of one form "touiches" the bottom of another form. what is the best way to achieve this?
0
Comment
Question by:mikesExpertExchange
[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
  • 3
  • 3
6 Comments
 
LVL 13

Expert Comment

by:ThievingSix
ID: 22805997
procedure AlignFormBottom(F1, F2: TForm);
begin
  F2.Top := F1.Top + (F1.Height - F2.Height);
end;


Should work.
0
 
LVL 13

Expert Comment

by:ThievingSix
ID: 22806001
Ah crap, read that wrong.

//F2 Is the form that will be on top.
procedure AlignForms(F1, F2: TForm);
begin
  F2.Top := F1.Top - F2.Height;
end;
0
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 22807202
unfortunately all that seemed to have done was to push form2 up. even through the top of the window of the screen on my computer. am i doing something wrong?
0
Technology Partners: 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 13

Accepted Solution

by:
ThievingSix earned 500 total points
ID: 22807229
procedure AlignForms(F1, F2: TForm);
begin
  F2.Top := F1.Top - F2.Height;
  If F2.Top < 0 Then
    begin
    F2.Top := 0;
    F1.Top := F2.Top + F2.Height;
  end;
end;
0
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 22807261
sorry disregard that statement. it does work just like your code states. its my forms. there is something else going oin with them that preventing it from doing the right thing. thanks.
0
 
LVL 1

Author Closing Comment

by:mikesExpertExchange
ID: 31510031
thanks
0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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