What you will need?
- Nothing, other than a form that is border-less
Source Code
- Public Class Form1
- Private mousex As Integer
- Private mousey As Integer
- Private dragged As Boolean = False
- Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
- If e.Button = MouseButtons.Left = True Then
- dragged = True
- mousex = e.X
- mousey = e.Y
- End If
- End Sub
- Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
- If dragged = True Then
- Dim oo As Point = New Point
- oo.X = Me.Location.X + (e.X - mousex)
- oo.Y = Me.Location.Y + (e.Y - mousey)
- Me.Location = oo
- oo = Nothing
- End If
- End Sub
- Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
- If e.Button = MouseButtons.Left = True Then
- dragged = False
- End If
- End Sub
- End Class
0 comments :
Post a Comment