Solved

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

Posted on 2004-04-19
4
199 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
[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
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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