Hi,
I have a form which has a panel which has a picturebox inside of that.
When a user clicks on the picture, it zooms by x2. The panel has
autoscroll set to true, so when the image is larger then the panel, I
can scroll to a different part of it. What I'm looking to do is when a
user clicks on the image,the point at which he/she clicks is then
centered in the panel by using autoscrollposition. My problem is that
I'm not sure of how to get x,y of the mouse position related to the
panel and not the screen. So either
A.) How can I get the x/y of the mouseposition related to the panel
only or
B.) How can I get the position of the upper lefthand corner of the
panel x/y related to the screen then subtract that or
C.) I'm just a noob
Thanks in advance
Rob 2 1422
Hi,
The form and all controls have the PointToClient method returns
the converted coordinates. Here is an example for a form
Dim pt As Point = Me.PointToClient(Cursor.Position)
Ken
-----------------
"Rob" <hu****@hotmail.com> wrote in message
news:42*************************@posting.google.co m... Hi,
I have a form which has a panel which has a picturebox inside of that. When a user clicks on the picture, it zooms by x2. The panel has autoscroll set to true, so when the image is larger then the panel, I can scroll to a different part of it. What I'm looking to do is when a user clicks on the image,the point at which he/she clicks is then centered in the panel by using autoscrollposition. My problem is that I'm not sure of how to get x,y of the mouse position related to the panel and not the screen. So either
A.) How can I get the x/y of the mouseposition related to the panel only or B.) How can I get the position of the upper lefthand corner of the panel x/y related to the screen then subtract that or C.) I'm just a noob
Thanks in advance Rob
PointToClient and PointToScreen methods may do what you need !
Regards - OHM
Rob wrote: Hi,
I have a form which has a panel which has a picturebox inside of that. When a user clicks on the picture, it zooms by x2. The panel has autoscroll set to true, so when the image is larger then the panel, I can scroll to a different part of it. What I'm looking to do is when a user clicks on the image,the point at which he/she clicks is then centered in the panel by using autoscrollposition. My problem is that I'm not sure of how to get x,y of the mouse position related to the panel and not the screen. So either
A.) How can I get the x/y of the mouseposition related to the panel only or B.) How can I get the position of the upper lefthand corner of the panel x/y related to the screen then subtract that or C.) I'm just a noob
Thanks in advance Rob
--
Best Regards - OHM
O_H_M{at}BTInternet{dot}com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Need_help |
last post by:
Sorry for inconveniance, but I couldn't check the newsgroup since friday. I
can't see any solutions right now on my post... So, one more time... (if
anyone noticed the solution)...
I have...
|
by: Robin Senior |
last post by:
Hi,
I'm trying to drag and drop onto a Panel on my form. The panel is inside
a groupBox, which of course is inside my form.
When dropping the item onto my Panel, I want it to appear at that...
|
by: ZorpiedoMan |
last post by:
Help... I need the screen coordinates of a control so I can place a pop
up form underneath it.
--Zorpy
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in...
|
by: Henry Wu |
last post by:
Hi, I see examples of Magnifying an area under mouse coordinates to a
form or picturebox using VB6 and VC6, does anyone know how to do it
under VB.NET? Its nice to use the new GDI+ for it.
...
|
by: aam |
last post by:
Hi. I am trying to find the cursor coordinates inside of a window, not a
form. I would like to display the coordinates of the cursor when you click
inside of the window. Either that, or have the...
|
by: Tomasz Bak |
last post by:
Hello,
I have a simple problem: mark a list of defects
on an image.
I think the best way to do it is to select a single
deffect, then take two coordinates of coursor
form an image on a web...
|
by: pcnerd |
last post by:
I created a demo program with a status bar & status bar label on the form.
When the program runs, it's maximized. When I move the mouse over the form, I
can see the X & Y coordinates changing on...
|
by: steve |
last post by:
Hi All
I have textboxes within a TableLayoutpanel and I want to be able to position
an independant control adjacent to a selected textbox
This independent control allows selection of text to...
|
by: raylopez99 |
last post by:
keywords: logical coordinates, page coordinates, world coordinates,
device coordinates, physical coordinates, screen coordinates, client
coordinates. offset rectangle. WYSIWYG rubber rectangle...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
| |