Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 09:16 PM
Henk ten Bos
Guest
 
Posts: n/a
Default Startup position of form

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


  #2  
Old July 17th, 2005, 09:16 PM
J French
Guest
 
Posts: n/a
Default Re: Startup position of form

On Sun, 9 Nov 2003 11:44:54 +0100, "Henk ten Bos" <henktb_1@xs4all.nl>
wrote:
[color=blue]
>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 ?)[/color]

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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles