10-04-19, 05:19 PM
10-04-19, 11:02 PM
هذا الكود من هذا الموضوع للاستاذ ahmadpal ولكن قمت بتنظيمه ليكون واضح
كود تحريك الفورم من خلال سحبه بالماوس
Dim x, y As Integer
Dim newpoint As New Point
Private Sub Panel1_Mousemove(sender As Object, e As MouseEventArgs) Handles Panel1.MouseDown
x = Control.MousePosition.X - sender.Location.X
y = Control.MousePosition.Y - sender.Location.Y
End Sub
Private Sub Panel1_MouseMove1(sender As Object, e As MouseEventArgs) Handles Panel1.MouseMove
'في الماوس موف للفور نكتب الكود التالي
If e.Button = Windows.Forms.MouseButtons.Left Then
newpoint = Control.MousePosition
newpoint.X -= x
newpoint.Y -= y
sender.Location = newpoint
Application.DoEvents()
End If
End Sub
كود تحريك الفورم من خلال سحبه بالماوس
Dim x, y As Integer
Dim newpoint As New Point
Private Sub Panel1_Mousemove(sender As Object, e As MouseEventArgs) Handles Panel1.MouseDown
x = Control.MousePosition.X - sender.Location.X
y = Control.MousePosition.Y - sender.Location.Y
End Sub
Private Sub Panel1_MouseMove1(sender As Object, e As MouseEventArgs) Handles Panel1.MouseMove
'في الماوس موف للفور نكتب الكود التالي
If e.Button = Windows.Forms.MouseButtons.Left Then
newpoint = Control.MousePosition
newpoint.X -= x
newpoint.Y -= y
sender.Location = newpoint
Application.DoEvents()
End If
End Sub
11-04-19, 04:01 PM
يسلمو اغاتي مقصرت 
