Page 1 of 1

New improved move borderless form native method

Posted: Wed Jan 30, 2013 5:56 am
by pip
I have not posted for a while and me and a friend found a native method of making moveable form :D

here is complete new code:
Code: Select all
Imports System.Runtime.InteropServices
Public Class Form1
    <DllImport("user32.dll")> _
    Public Shared Function ReleaseCapture() As Boolean
    End Function
    <DllImport("user32.dll")> _
    Public Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
    End Function
    Private Sub Form1_MouseDown(sender As Object, e As MouseEventArgs) Handles MyBase.MouseDown
      ReleaseCapture()
        SendMessage(Handle, &HA1, &H2, 0)
    End Sub
    Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs) Handles MyBase.MouseMove
     ReleaseCapture()
        SendMessage(Handle, &HA1, &H2, 0)
    End Sub
End Class

Re: New improved move borderless form native method

Posted: Tue Feb 05, 2013 11:53 am
by noypikami
this code is really cool,,, this makes coding more easy and faster..... cooll;

Re: New improved move borderless form native method

Posted: Thu Feb 07, 2013 11:22 am
by Bloodz_Ninja
nice one bro cooll; but there is also a method without using dll's