Results 1 to 2 of 2
  1. #1
    mark1993's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    1

    Borderless Movable Form

    Here's the code if you want to make a borderless movable form

    Public Class Form1

    Dim drag As Boolean
    Dim mousex As Integer
    Dim mousey As Integer

    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
    drag = True
    mousex = Windows.Forms.Cursor.Position.X - Me.Left
    mousey = Windows.Forms.Cursor.Position.Y - Me.Top
    End Sub

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
    If drag Then
    Me.Top = Windows.Forms.Cursor.Position.Y - mousey
    Me.Left = Windows.Forms.Cursor.Position.X - mousex
    End If
    End Sub

    Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
    drag = False
    End Sub


    End Class



    -mark1993

  2. The Following User Says Thank You to mark1993 For This Useful Post:

    qEnigma (12-28-2017)

  3. #2
    qEnigma's Avatar
    Join Date
    Dec 2017
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    9
    My Mood
    Psychedelic
    Thanks for posting

Similar Threads

  1. [Source Code] Perfect native borderless form moving using any control
    By Matroix73 in forum Visual Basic Programming
    Replies: 12
    Last Post: 04-28-2013, 03:54 PM
  2. [Solved] Help Moving Borderless Window
    By calvin839 in forum Visual Basic Programming
    Replies: 10
    Last Post: 06-28-2012, 11:58 AM
  3. TUT]How to move a borderless form[TUT
    By XGelite in forum Visual Basic Programming
    Replies: 7
    Last Post: 11-14-2009, 03:11 PM
  4. How to Move Form
    By MinimalKills in forum Visual Basic Programming
    Replies: 3
    Last Post: 11-14-2009, 10:12 AM