Home of Gamehacking - Archiv
Form ohne Titelleiste verschieben - Druckversion

+- Home of Gamehacking - Archiv (http://archiv-homeofgamehacking.de)
+-- Forum: Coding (http://archiv-homeofgamehacking.de/forumdisplay.php?fid=15)
+--- Forum: Visual Basic 6, VB.NET (http://archiv-homeofgamehacking.de/forumdisplay.php?fid=19)
+--- Thema: Form ohne Titelleiste verschieben (/showthread.php?tid=83)



Form ohne Titelleiste verschieben - DNA - 12.09.2010

Mit dem folgenden code könnt ihr eine Form verschieben, wenn diese
keine Titelleiste hat.

Am besten erstellt ihr euch ein neues Modul und fügt folgendes dort ein



Zum aufrufen fügt man folgendes in Form1.vb ein




RE: Form ohne Titelleiste verschieben - Bluespide - 12.09.2010

in VB.Net nehme ich nen anderen der is einfacher und kürzer finde ich:rolleyes:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
Private MausPosition As Point

    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Left Then
            MausPosition = e.Location
        End If
    End Sub

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        If e.Button = Windows.Forms.MouseButtons.Left Then
            Me.Location = e.Location - MausPosition + Me.Location
        End If
    End Sub