1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
' =====================================================================================
' =============== Fenster Bewegen mit gedrückter Maustaste ============================
' =====================================================================================
#Region "Fenster bewegen mit Maus"
Private CurrentPosition As New System.Drawing.Point
Private MouseButton As System.Windows.Forms.MouseButtons = Nothing
Private Overloads Sub OnMouseDown(ByVal Sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
MyClass.MouseButton = e.Button()
Softwareliste.Update()
With MyClass.CurrentPosition
.X = e.X()
.Y = e.Y()
End With
End Sub
Private Overloads Sub OnMouseMove(ByVal Sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
Select Case MouseButton
Case Is = Windows.Forms.MouseButtons.Left
MyClass.Top = Windows.Forms.Cursor.Position.Y() - MyClass.CurrentPosition.Y()
MyClass.Left = Windows.Forms.Cursor.Position.X() - MyClass.CurrentPosition.X()
Softwareliste.Update()
Case Is = Nothing
Softwareliste.Update()
Exit Sub
End Select
End Sub
Private Overloads Sub OnMouseUp(ByVal Sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
MyClass.MouseButton = Nothing
End Sub
#End Region
|