473,407 Members | 2,312 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,407 software developers and data experts.

how calc the DesktopLocation of a control on a Form?

I am using ShowDialog to show a popup form and want to position the
popup relative to the control on the form the popup is pertinent to.
For this, I am using FormStartPosition.Manual to set the position of
the form relative to the desktop.

I can calc the location of a control relative to the client rect of a
form. But since I am positioning the popup form relative to the
desktop, I need to know the DesktopLocation of controls on the form.

thanks,

Sep 9 '07 #1
2 2159
nevermind, got it. PointToScreen and PointToClient. very nice.
On Sep 9, 4:33 pm, Steve Richter <StephenRich...@gmail.comwrote:
I am using ShowDialog to show a popup form and want to position the
popup relative to the control on the form the popup is pertinent to.
For this, I am using FormStartPosition.Manual to set the position of
the form relative to the desktop.

I can calc the location of a control relative to the client rect of a
form. But since I am positioning the popup form relative to the
desktop, I need to know the DesktopLocation of controls on the form.

thanks,

Sep 9 '07 #2
Hi,

the Control class has a PointToScreen method which turns coordinates
expressed relative to the control's location into coordinates that are
relative to the top left corner of the desktop.

Thorsten

Steve Richter schrieb:
I am using ShowDialog to show a popup form and want to position the
popup relative to the control on the form the popup is pertinent to.
For this, I am using FormStartPosition.Manual to set the position of
the form relative to the desktop.

I can calc the location of a control relative to the client rect of a
form. But since I am positioning the popup form relative to the
desktop, I need to know the DesktopLocation of controls on the form.

thanks,
Sep 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Astra | last post by:
Hi All Wonder if you can help me with the following calc, which I want to create to check whether or not a user has entered a valid credit card expiry date: 1) I have retrieve a value from 2 x...
12
by: Susan Cranford | last post by:
Please forgive, I have looked at so much info I can't figure out how to put it together even though I know it must be fairly simple. I have an array of input text boxes (txtDOBn) where n is...
4
by: qtip | last post by:
I have a simple table the has First Name , Last Name, SSN, Date&Time. I have a report that will show all this information but I would like to put in at calculation to tell the difference between 2...
4
by: cpaul | last post by:
So in a table I have a field that I want populated with the result of an arithmatic expression. For example, one field named VALUE, populated with a form, is a variable in an expression like VALUE *...
6
by: vj | last post by:
I have a program which generates xml files for excel but these files are not recognized by open office calc. I looked at the OO uno library, but it seems like an over kill. In my experience, for...
21
by: mm | last post by:
(Yes, I konw whats an object is...) BTW. I did a translation of a pi callculation programm in C to Python. (Do it by your own... ;-) -------- Calc PI for 800 digs(?). (german: Stellen) ------...
7
by: sparks | last post by:
I am working on a database that has a lot of calculated values on the forms. These were never put into the tables. But were tied to unbound fields on the forms. Now 8000 records later they want...
14
by: akshaycjoshi | last post by:
The code below shows the same values for both private void mainform_Move(object sender, EventArgs e) { lbllocation.Text = "location" + this.Location.ToString(); ...
2
by: ducttape | last post by:
Hello I'm busy working with an MDI parent and child forms. I've found that there is a discrepancy between the locations returned by DesktopLocation, Control.MousePosition and MouseEventArgs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...

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.