473,322 Members | 1,806 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,322 software developers and data experts.

Absolute location in winform

Hi, I need to find a way to determinate where a control is on a windows form or panel control. I have a panel contro setted with autoscroll = true and when I move a control contained by it, I need to know where the control really is on the panel. So what the location show me is the position on the part of panel show in screen, it means that if I scroll the panel, the position of that control change.

Could some one help me?
Oct 2 '07 #1
1 2892
In Win32

Call GetWindowRect( ) first, which provides the position and size of a window in screen coordinates.

Then call ScreenToClient( ), which translates screen coordinates to relative coordinates of a window, if you provide the window handle of the control's parent window, ScreenToClient will give you the info you need
Oct 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Nick K. | last post by:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I...
1
by: Yongseung Kim | last post by:
Hi, I would like to describe as clear as I can(sorry my english is quite limited) 1. I made a project with vb.net on english XP Pro (The project has a winform with several general controls...
4
by: Pf | last post by:
A piece of html code: <table> <tr> <td> <input type="text" name="myInput" onclick="myFunction(this)"> <td> </tr> </table>
1
by: Harrie Verveer | last post by:
is there a way to convert an absolute path (C:\inetpub\wwwroot\project\folder\another_folder\file.jpg) to an url? I used this code: --- string sk = Server.MapPath(".").ToLower(); url_to_use =...
5
by: Paul | last post by:
I am trying to create a log of certain events on the website by writing them to a text file. The logging code is in an "included" file that is inserted into the pages that need to be monitored....
5
by: Jon Slaughter | last post by:
Is there a way to get a controls location in screen coordinates? (not relative to the container it is in)? Thanks, Jon
2
by: lucius | last post by:
I have a List of DateTimes that look like this {1753-01-01 16:00:00} {1753-01-01 22:00:00} And I would like to do something in my WinForm/CommandLine app that does MyMethod() every day at...
2
by: Adam Right | last post by:
Hi All, I'm developping a site using VS2008 (c#) on IIS 6.0. In my application images are not shown by the image control, they are in the web server machine and the main folder path is...
1
by: Miro | last post by:
In my book the book drags a datagridview and a detailsdatagrid onto the form, The person is able to set the two grids side by side. In mine - i can only seem to set them under eachother. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.