Wednesday, March 22, 2023

VB.NET HOW TO MAKE A LOGIN DESIGN FLAT FORM

 HI GUYS,I WILL SHARE THE CODES ON FLAT FORM DESIGN FOR VB.NET.







FORM CODES:



Public Class Form1



    Public Const WM_NCLBUTTONDOWN As Integer = &HA1

    Public Const HT_CAPTION As Integer = &H2


    Private Sub Panel1_MouseDown(sender As Object, e As MouseEventArgs) Handles Panel1.MouseDown

        If e.Button = Windows.Forms.MouseButtons.Left Then

            rcmove.ReleaseCapture()

            rcmove.SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0)

        End If

    End Sub


    Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click

        Application.Exit()

    End Sub


    Private Sub Label2_MouseDown(sender As Object, e As MouseEventArgs) Handles Label2.MouseDown

        If e.Button = Windows.Forms.MouseButtons.Left Then

            rcmove.ReleaseCapture()

            rcmove.SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0)

        End If

    End Sub

End Class


MODULE CODES:

Imports System

Imports System.Runtime.InteropServices

Imports System.Windows.Forms


Module rcmove

    Public Const WM_NCLBUTTONDOWN As Integer = &HA1

    Public Const HT_CAPTION As Integer = &H2


    <DllImportAttribute("user32.dll")>

    Public Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer

    End Function


    <DllImportAttribute("user32.dll")>

    Public Function ReleaseCapture() As Boolean

    End Function

End Module





PLEASE DONT FORGET TO SUPPORT MY WEBSITE BY CLICKING ANY ADVERTISE LINK.

THANKS!




No comments: