How can the following code be change so the children form move event is smoother?
Dim isMouseDown As Integer
Dim MyX, MyY As Integer
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
isMouseDown = 1
MyX = e.X : MyY = e.Y
'Me.Cursor = Cursors.SizeAll
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If isMouseDown = 1 Then
If e.X > MyX Then Me.Left = Me.Left + 1
If e.X < MyX Then Me.Left = Me.Left - 1
If e.Y > MyY Then Me.Top = Me.Top + 1
If e.Y < MyY Then Me.Top = Me.Top - 1
End If
End Sub
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
isMouseDown = 0
Me.Cursor = Cursors.Default
End Sub
THanks
2
Contributors
2
Replies
1 Day
Discussion Span
3 Months Ago
Last Updated
3
Views
Related Article:'X' on Control Box
is a VB.NET discussion thread by Gus_19 that has 3 replies and was last updated 1 year ago.