hallo Community
Mein Problem ist eigentlich ganz simple:
Ein Panel Hin und Hert ziehen
Mein Code bis Jetzt:
Alles Klappt super, nur wenn ich das Panel ziehe Springt mir es geschätzte 150 Pixel nach schräg unten.
Wodrin liegt mein Denkfehler?? Tipps sind willkommen...
HerrBert
Mein Problem ist eigentlich ganz simple:
Ein Panel Hin und Hert ziehen
Mein Code bis Jetzt:
VB.NET-Quellcode
- Public Class Form1
- Dim dif As New Point
- Dim md As Boolean = False
- Private Sub Panel1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
- md = True
- dif = New Point(e.X, e.Y)
- 'MsgBox(dif.X.ToString & " - " & dif.Y.ToString)
- End Sub
- Private Sub Panel1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
- If md Then
- Panel1.Location = New Point(Cursor.Position.X + dif.X, Cursor.Position.Y + dif.Y)
- End If
- End Sub
- Private Sub Panel1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
- md = False
- End Sub
- End Class
Alles Klappt super, nur wenn ich das Panel ziehe Springt mir es geschätzte 150 Pixel nach schräg unten.
Wodrin liegt mein Denkfehler?? Tipps sind willkommen...
HerrBert
Linux wird nie das meistinstallierte Betriebssystem sein. Bedenken Sie nur, wie oft man Windows neu installieren muss!