Solved

Position a window at run-time in relation to its parent (not ownercentre etc)

Posted on 2004-04-19
4
194 Views
Last Modified: 2010-04-05
I have a very small window that gets created when its parent does, but I dont want it to sit in the middle of its parent, but down in the bottom left corner of the parents window.  How can I determine the screen position it should go to (assuming I know the width of the 2 windows and the start position of the parent)
0
Comment
Question by:mikelittlewood
  • 2
4 Comments
 
LVL 17

Expert Comment

by:mokule
ID: 10858402
Left := 0;
Top := Parent.Height-Height;
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 50 total points
ID: 10858432

  procedure TForm2.FormShow(Sender: TObject);
  begin
    Left := Form1.Left;
    Top  := (Form1.Top + Form1.Height) - Height;
  end;
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10858530
Thanks all ...

I got it working using the second solution.
For some reason using "Parent.<>" just keeps throwing up errors
0
 
LVL 17

Expert Comment

by:mokule
ID: 10858613
Sure it throws errors. I've thought that You change it by what is really parent.
BTW
It seems that You haven't Parent/Child relationship if the second solution works ok.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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 …

791 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