Solved

align forms

Posted on 2008-10-25
6
335 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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