|
-
Aug 10th, 2011, 06:02 AM
#1
Thread Starter
New Member
Windows Location, relative forms.
Hi,
I'm currently developing some software, in which I developed my own Input system for Forms. Today I'm focusing on the one thing I'm baffled to understand.
I have my normal Form1 as it were to a blank project, and inside that I called a new form to be created ( Custom message box ). It works all fine. However I'm wanting to make this new created forms location relative to the main forms X/Y coords.
So for instance, Main form opens, click button, it creates my new form but to the right hand side of the main form and if more are created at the same time it's position would be now relative to the main form and the currently opened msgbox. Here's an image of my question
-
Aug 10th, 2011, 09:30 AM
#2
Re: Windows Location, relative forms.
The theory is straight forward enough if all your boxes above are windows. You set the .Position of the new msgbx relative to the form, or the last created msgbx. So the form has its own Form.Left, you just add on its Form.Width and you are at the right-hand side. You can get the msgbx.Height and minus that from the Form.Height, to get the distance, add on the Form.Top and you have the correct location. It's just maths, I have given you the keywords you need, have a go.
-
Aug 10th, 2011, 09:34 AM
#3
Thread Starter
New Member
Re: Windows Location, relative forms.
Ah great, I wasn't aware I could derive forms .Left with the Width as I thought .Left was just a temporary holder of the value. Appreciate the support, thanks.
-
Aug 10th, 2011, 02:01 PM
#4
Re: Windows Location, relative forms.
You can work with Position.X and Position.Y I believe, guess .Left is a hangover pointing to the same value anyway.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|