By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,218 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,218 IT Pros & Developers. It's quick & easy.

Startup position of form

P: n/a
Hi All,

consider the following situation: I have a form that contains an image.
I would like to show a second form where at startup the top left corner of
this second form is positioned exactly at the top left corner of the image
on the 1st form.
How do I calculate this position (taking into account that the form might
have a menubar and toolbars - so form1.top+image.top is not the correct
value !)

any ideas (e.g. what is the height of a menubar in twips ?)

thanks,
Henk
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sun, 9 Nov 2003 11:44:54 +0100, "Henk ten Bos" <he******@xs4all.nl>
wrote:
Hi All,

consider the following situation: I have a form that contains an image.
I would like to show a second form where at startup the top left corner of
this second form is positioned exactly at the top left corner of the image
on the 1st form.
How do I calculate this position (taking into account that the form might
have a menubar and toolbars - so form1.top+image.top is not the correct
value !)

any ideas (e.g. what is the height of a menubar in twips ?)


The height of the MenuBar and the borders is
Form.Height - Form.ScaleHeight

The height of the borders should be the same as their width
Form.Width - Form.ScaleWidth

However the API ClientToScreen is simpler - it works in pixels
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.