Solved

align forms

Posted on 2008-10-25
6
332 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This video discusses moving either the default database or any database to a new volume.
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.

757 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

21 Experts available now in Live!

Get 1:1 Help Now