If you want develop the desktop application and replace the default windows form with your own custom layout. Here's the tutorial how to make a custom layout and make it as your template form.
First this custom layout using Microsoft Visual Studio Enterprise 2015 and Visual Basic.Net as programming language.
to make the custom layout we need a project, we can create new project on visual studio and put project folder anywhere on your drive. in this case I put the project folder to drive X:\Tutorial\Desktop\CustomLayout and CustomLayout as project solution name.
And now we have a project with a blank windows form.
Here we start setting this blank windows form properties. you can see properties with right click on the blank windows form and then select properties. so, properties tab will be shown. in this properties we need disable default windows form layout. change BackColor to LightGray and change FormBorderStyle value to None
so, the border of windows form will be remove. and now we start customize the layout.
we need some toolbox:
Public Class Form1
Dim Xpos As New Integer
Dim Ypos As New Integer
Dim pos As New Point
End Class
Public Class Form1
Dim Xpos As New Integer
Dim Ypos As New Integer
Dim pos As New Point
Private Sub Panel1_MouseDown(sender As Object, e As MouseEventArgs) Handles Panel1.MouseDown, Label1.MouseDown, PictureBox1.MouseDown
Xpos = Cursor.Position.X - Me.Location.X
Ypos = Cursor.Position.Y - Me.Location.Y
End Sub
Private Sub Panel1_MouseMove(sender As Object, e As MouseEventArgs) Handles Panel1.MouseMove, Label1.MouseMove, PictureBox1.MouseMove
If e.Button = MouseButtons.Left Then
pos = MousePosition
pos.X = pos.X - Xpos
pos.Y = pos.Y - Ypos
Me.Location = pos
End If
End Sub
End Class
Public Class Form1
Dim Xpos As New Integer
Dim Ypos As New Integer
Dim pos As New Point
Private Sub Panel1_MouseDown(sender As Object, e As MouseEventArgs) Handles Panel1.MouseDown, Label1.MouseDown, PictureBox1.MouseDown
Xpos = Cursor.Position.X - Me.Location.X
Ypos = Cursor.Position.Y - Me.Location.Y
End Sub
Private Sub Panel1_MouseMove(sender As Object, e As MouseEventArgs) Handles Panel1.MouseMove, Label1.MouseMove, PictureBox1.MouseMove
If e.Button = MouseButtons.Left Then
pos = MousePosition
pos.X = pos.X - Xpos
pos.Y = pos.Y - Ypos
Me.Location = pos
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If Me.WindowState = FormWindowState.Normal Then
Me.WindowState = FormWindowState.Maximized
Else
Me.WindowState = FormWindowState.Normal
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class