?
Solved

align forms

Posted on 2008-10-25
6
Medium Priority
?
340 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:Michael Sterling
[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:Michael Sterling
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
Industry Leaders: 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 2000 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:Michael Sterling
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:Michael Sterling
ID: 31510031
thanks
0

Featured Post

Industry Leaders: 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

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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