PointToScreen returns Screen based coordinates: Based on the top left corner of your monitor, not the containing form which contains the TextBox. If you set the TextBox to Screen coordinates, then it will be offset on your form by the amount that the form TLHC is offset from the screen TLHC. e.X and e.Y are already relative to the Form, and need no translation to be the "right place" for your textbox:
txt_Drag.Location = New Point(e.X, e.Y)
Quote:
Thats the first code i tried...when i used that code ,the top left corner of the listview detect as the top left corner of the form..
Ah! You want it relative to the ListView! All you need to do is offset it by the TLHC of the Event sender:
Dim c As Control = TryCast(sender, Control)
txt_Drag.Location = New Point(c.Location.X + e.X, c.Location.Y + e.Y)