<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div><span class="">I do not believe that he can position the text in the TextArea, "directly" according to the ".X" and ".Y" Properties, or ".ScreenX" and ".ScreenY" of the Mouse Class.</span><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div><br></div><div><br></div><div>12 nov 2023, 16:42 da bsteers4@gmail.com:<br></div><blockquote class="tutanota_quote" style="border-left: 1px solid #93A3B8; padding-left: 10px; margin-left: 5px;"><div dir="ltr"><div dir="ltr"><div style="font-size:small" class=""><br></div></div><div><br></div><div class=""><div class="" dir="ltr">On Sun, 12 Nov 2023 at 15:04, sbungay <<a href="mailto:sbungay@smartsonsite.com" rel="noopener noreferrer" target="_blank">sbungay@smartsonsite.com</a>> wrote:<br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class=""><div> I've been struggling with dragging data from a TreeView to a Text <br></div><div> Area, and I THINK I've found the source of the frustration.<br></div><div> <br></div><div> Both the TreeView and TextArea have Tracking enabled. So everything <br></div><div> is OK there.<br></div><div> <br></div><div> The Drag begins and the Mouse.X and Mouse.Y coordinates are given <br></div><div> relative to where it was in the TreeView when that event fires. Lets say <br></div><div> the values are, respectively, 21 and 88. Dragging the text from the <br></div><div> TreeView to the position in the TextArea where it needs to be inserted <br></div><div> it ALWAYS inserts it in the wrong spot, and the Mouse.X and Mouse.Y <br></div><div> remain set at 21 and 88, which explains why insertion did not take place <br></div><div> at the desired location.<br></div><div> <br></div><div> Shouldn't the Mouse.X and Mouse.Y be updated to the coordinates of the <br></div><div> pointer relative to the control over which the drop occurred?<br></div><div> <br></div><div> -- <br></div><div> Steve.<br></div></blockquote><div><br></div><div class="" style="font-size:small">No because Mouse.X and Mouse.Y are object relative positions.so belong to the calling objects Drag event<br></div><div class="" style="font-size:small"><br></div><div class="" style="font-size:small"><br></div><div class="" style="font-size:small">See Drag.X and Drag.Y<br></div><div class="" style="font-size:small"><br></div><div class="" style="font-size:small">Or use Mouse.ScreenX , Mouse.ScreenY with the dropped objects screen positions.<br></div><div class="" style="font-size:small"><br></div><div class="" style="font-size:small">Dim iDropRelativeMouseX = Mouse.ScreenX - MyDroppedControl.ScreenX<br></div><div class="" style="font-size:small"><div class="" style="font-size:small">Dim iDropRelativeMouseY = Mouse.ScreenY - MyDroppedControl.ScreenY<br></div><div class="" style="font-size:small"><br></div><div class="" style="font-size:small">BruceS<br></div><div class="" style="font-size:small"><br></div></div></div></div></blockquote><div dir="auto"><br></div> </body>
</html>