Hello,
This is an tutorial to make a custom gui
~
Step1:
Create New Form And Set Formborderstyle to None
Step2:
Add An Panel And Give It An Background Image (this is gonna be kinda header)
Step3:
Add This Under Public Class Form1:
Code:
Dim Xpos As New Integer
Dim Ypos As New Integer
Dim Pos As New Point
Step4:
Add To Panel1_MouseDown:
Code:
Xpos = Cursor.Position.X - Me.Location.X
Ypos = Cursor.Position.Y - Me.Location.Y
That Part Should look like this:
Code:
Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
Xpos = Cursor.Position.X - Me.Location.X
Ypos = Cursor.Position.Y - Me.Location.Y
End Sub
Step5:
Add To Panel1_Mousemove:
Code:
If e.Button = Windows.Forms.MouseButtons.Left Then
Pos = MousePosition
Pos.X = Pos.X - Xpos
Pos.Y = Pos.Y - Ypos
Me.Location = Pos
End If
That Part Should Look Like This:
Code:
Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Pos = MousePosition
Pos.X = Pos.X - Xpos
Pos.Y = Pos.Y - Ypos
Me.Location = Pos
End If
End Sub
Step6:
Add 2 Labels And Put Them In The "Header" And Make Them Transparant
Label1.text = X
Label2.text = _
Step7:
Label1_click:
Label2_click:
Code:
Me.WindowState = FormWindowState.Minimized
Its my first tutorials so it isnt the best one but:
Good Tutorial?
Got Tutorial Tips? Tell ME (A)
Example:
Red Header(Downloaded), Blue Flames(Downloaded) As Background and you get this:
