I'm trying to make a borderless form draggable. I'm using the following code:
Code:Imports System.Runtime.InteropServices Public Class FormDrag Public Const WM_NCLBUTTONDOWN As Integer = &HA1 Public Const HT_CAPTION As Integer = &H2 <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 <DllImport("user32.dll")> Public Shared Function ReleaseCapture() As Boolean End Function End ClassNot working, help please.Code:' Make Form1 draggable Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) FormDrag.ReleaseCapture() FormDrag.SendMessage(Me.Handle, FormDrag.WM_NCLBUTTONDOWN, FormDrag.HT_CAPTION, 0) End Sub




Reply With Quote
