Custom max/min button for borderless forms

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
2 posts Page 1 of 1
Contributors
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

Well I was just working on a project of mine and thought that the normal .maximized thing just fills the hole screen soo how can I fix this soo I came up with this

So to start go to settings and make two settings
My_Size - system.drawing.point
My_location - System.Drawing.Point

now double click your form load and put this in
Code: Select all
   Me.Size = My.Settings.My_size
Me.Location = My.Settings.My_location
Now come to the form close event and add this
Code: Select all
My.Settings.My_size = Me.Size
 My.Settings.My_location = Me.Location 
now for the kwl bit double click you maximize button and put in this
Code: Select all
  If Me.Height = Screen.PrimaryScreen.Bounds.Height - 40 Then
            Me.Size = My.Settings.My_size
            Me.Location = My.Settings.My_location
        Else
            Me.Height = Screen.PrimaryScreen.Bounds.Height - 40
            Me.Width = Screen.PrimaryScreen.Bounds.Width
            Me.Location = New Point(0, 0)
        End If


Hope this help you lot I know its going to help me Tonz and it can make sure you program allways fits peoples screen rezalutions as well if you play with it
User avatar
Shim
VIP - Donator
VIP - Donator
Posts: 882
Joined: Wed Dec 14, 2011 5:02 am

this is a good tut , thanks for posting .
Find my programs on Softpedia
2 posts Page 1 of 1
Return to “Tutorials”