Please help
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts
Page 1 of 1
Does any one know how to make a hole form dock i would like to make my form dock to the top of the screen or the bottom of the screen if anyone knows how to do this would you please be able to enlighten me
add this under Public Class
Code: Select all
then you can change position like this
Public Enum Position
Top_Right = 1
Top_Centre = 2
Top_Left = 3
Middle_Right = 4
Middle_Center = 5
Middle_Left = 6
Bottom_Right = 7
Bottom_Center = 8
Bottom_Left = 9
End Enum
Private Sub WindowPossition(ByVal pos As Position)
If Me.WindowState = FormWindowState.Normal Or Me.WindowState = FormWindowState.Minimized Then
Select Case pos
Case Is = Position.Bottom_Left
Me.Location = New Point(0, Screen.PrimaryScreen.WorkingArea.Height - Me.Height)
Case Is = Position.Bottom_Center
Me.Location = New Point((Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2, Screen.PrimaryScreen.WorkingArea.Height - Me.Height)
Case Is = Position.Bottom_Right
Me.Location = New Point((Screen.PrimaryScreen.WorkingArea.Width - Me.Width), Screen.PrimaryScreen.WorkingArea.Height - Me.Height)
Case Is = Position.Middle_Center
Me.Location = New Point((Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2, (Screen.PrimaryScreen.WorkingArea.Height - Me.Height) / 2)
Case Is = Position.Middle_Left
Me.Location = New Point((0), (Screen.PrimaryScreen.WorkingArea.Height - Me.Height) / 2)
Case Is = Position.Middle_Right
Me.Location = New Point(Screen.PrimaryScreen.WorkingArea.Width - Me.Width, (Screen.PrimaryScreen.WorkingArea.Height - Me.Height) / 2)
Case Is = Position.Top_Centre
Me.Location = New Point((Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2, 0)
Case Is = Position.Top_Left
Me.Location = New Point(0, 0)
Case Is = Position.Top_Right
Me.Location = New Point((Screen.PrimaryScreen.WorkingArea.Width - Me.Width), 0)
End Select
End If
End Sub
Code: Select all
WindowPossition(Position.Bottom_Center)
You can find me on Facebook or on Skype mihai_92b
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023