Wednesday, April 28, 2010

How to make form move Borderless (No Title Bar) Visual Basic {VB.net}

Hi all, Today i will be showing u all how to make your vb.net form move without any borders (title bar), so lets begin..!

Codes:

Public Class Form1

#Region " Global Variables "
Dim Point As New System.Drawing.Point()
Dim X, Y As Integer
#End Region

#Region " GUI "
Private Sub Form_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If e.Button = MouseButtons.Left Then
Point = Control.MousePosition
Point.X = Point.X - (X)
Point.Y = Point.Y - (Y)
Me.Location = Point
End If
End Sub

Private Sub Form_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
X = Control.MousePosition.X - Me.Location.X
Y = Control.MousePosition.Y - Me.Location.Y
End Sub
#End Region

End Class
_________________________________________________________________________
2. Minimize Box: Add one PictureBox component and choose get the image of minimize button from internet and choose that image. Now double click that image and type in the following code.

Minimize Box:
WindowState = FormWindowState.Minimized

--------------------------------------------------
Close box:
me.close
_________________________________________________________________________

Here is the video tutorial:

No comments:

Post a Comment