Basetool Mouse Double-click event to get the mouse position method

Source: Internet
Author: User

Arcgisengine's Basetool class provides mouse double-click, mouse movement, mouse button press, mouse button up four kinds of mouse events, but the mouse double-click event parameters with the other three different, double-click event does not provide the mouse location information.

public virtual void OnDblClick ();

public virtual void OnMouseDown (int Button, int Shift, int X, int Y);

public virtual void OnMouseMove (int Button, int Shift, int X, int Y);

public virtual void OnMouseUp (int Button, int Shift, int X, int Y);

Today in the overload double-click event, in order to get the mouse double-click in the Mapping page location, found a lot of information, finally thought of a solution.

1, first get the position of the mouse in the screen, control.mouseposition

2. Convert absolute screen coordinates to screen coordinates relative to Pagelayoutcontrol, Axpagelayoutcontrol.pointtoclient (control.mouseposition), note that Only Axpagelayoutcontrol has this function, Pagelayoutcontrol has no conversion function. This step is already available, but if you want to get the page coordinates of the mouse in Pagelayoutcontrol, you need a third step.

3. Convert screen coordinates to cartographic page coordinates, Pagelayoutcontrol.topagepoint (Pt. X, Pt. Y

Basetool Mouse Double-click event to get the mouse position method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.