Remember Window Position - Tutorial
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.
3 posts
Page 1 of 1
Hello guys.
Here I present my new tutorial.
This tutorial will teach you how to remember your application window's once it has been moved from its original position.
Ok so lets start -
1. Open VB.NET and create a new Windows Forms Application.
2. Once the project is created, on the menu strip on the top, click on Project--->WindowsFormsApplication1 Properties
3. Once you click there, go on the Settings tab.
4. Create a new setting with the following properties -
Name - Position
Type - System.Drawing.Point
Scope - User
5. Then go to Form1 and the in the properties expand the ApplicationSettings and set the location property to Position.
6. Debug the project, move the form anywhere on the screen and then exit the app.
7. Debug the project again. Your application will load in the position from where you exit it last time.
Hope you liked my tutorial.
Regards, cooll;
CoderBoy1201
Here I present my new tutorial.
This tutorial will teach you how to remember your application window's once it has been moved from its original position.
Ok so lets start -
1. Open VB.NET and create a new Windows Forms Application.
2. Once the project is created, on the menu strip on the top, click on Project--->WindowsFormsApplication1 Properties
3. Once you click there, go on the Settings tab.
4. Create a new setting with the following properties -
Name - Position
Type - System.Drawing.Point
Scope - User
5. Then go to Form1 and the in the properties expand the ApplicationSettings and set the location property to Position.
6. Debug the project, move the form anywhere on the screen and then exit the app.
7. Debug the project again. Your application will load in the position from where you exit it last time.
Hope you liked my tutorial.

Regards, cooll;
CoderBoy1201
Instead of LOL use this -
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
Maybe add some images this is kindof confusing :?
What he said is kind of really advanced, havent tried it myself but seems good. The normal way of using the setting is:
Create a form .Load event:
Create a form .Load event:
Code: Select all
And on the form .Closing event:
Me.Location = My.Settings.Location
Code: Select all
My.Settings.Location = Me.Location
My.Settings.Save()
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023