Solved

align forms

Posted on 2008-10-25
6
333 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

22 Experts available now in Live!

Get 1:1 Help Now