27-10-18, 12:04 PM
تحريك الفورم عن طريق سحبه بالفارة
نقوم بتعريف 3 متغيرات في الببلك فورم
كود :
Dim x, y As Integer
Dim newpoint As New Point
في الماوس داون للفورم نكتب الكود التالي
كود :
x = Control.MousePosition.X - Me.Location.X
y = Control.MousePosition.Y - Me.Location.Y
في الماوس موف للفور نكتب الكود التالي
If e.Button = Windows.Forms.MouseButtons.Left Then
newpoint = Control.MousePosition
newpoint.X -= x
newpoint.Y -= y
Me.Location = newpoint
Application.DoEvents()
End If