473,414 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

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
Jul 17 '05 #1
1 3729
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rikesh | last post by:
Hi Does anyone, know how to control the start-up position of a browser window, such as centre screen, top left, etc.... -- Kind Regards Rikesh
2
by: AP | last post by:
I am trying to find the integer value for the cursor position in a text box, in particular I want to find out if I am at the end of some text that I typed or at the beginning. I am using IE 6. ...
1
by: Ian | last post by:
Hi, I have noticed some strange behaviour when loading my database. I load a menu form on startup; this form contains a linked image to display. If the project is not then signed, the menu form...
5
by: peter hansen | last post by:
In old Visual BASIC 6-days it was possible to set the Left and Top-property of a Form and put it into the center of the screen by using the Screen.Left, Screen.Width, Top and Height. Where do I...
3
by: Rich Wallace | last post by:
Hi all, How can I load a form and display it in the lower right hand corner and have a 'docked' appearance to the system tray? TIA, -Rich
3
by: John Devlon | last post by:
Hi, does anyone know how to change a form loaction ? I tried ... frmTest = new Form frmTest.location = new point (0,0) frmTest.show()
2
by: Rich | last post by:
Greetings. I have a child form inside an MID parent form. The child form is wider than the MID parent form. The child form contains a number of textboxes which are positioned from left to...
4
by: Andrus | last post by:
I have WinForms MDI application. MDI child forms are created by menustrip click enent handler AppDesktop.FormMgr.Show(new ChildForm1("param1", "param2") ); Every MDI child form "childform1"...
0
by: yxq | last post by:
Hello, I want to startup a form with hidden way like anti-virus software, how to do? //////////////////////////////////////////// Private Sub frmMain_Load(ByVal Sender As System.Object, ByVal...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.