. Net2.0 automatically saves the form position and size when the form is closed.

Source: Internet
Author: User
. Net2.0 is ready for us.
In the form property (applicationsettings)-(propertybinding), click the button.
Click Create location and enter the name of your settings. mylocation is set.
Create a new myclientsize and then OK.
Open the settings tab in your project properties, and you will see the mylocation and myclientsize.
Then read Code : Using System;
Using System. Collections. Generic;
Using System. componentmodel;
Using System. Data;
Using System. drawing;
Using System. text;
Using System. Windows. forms;

namespace savewindowsizeandlocation
{< br> Public partial class form1: form
{< br> Public form1 ()
{< br> initializecomponent ();
}

Private VoidForm1_formclosing (ObjectSender, formclosingeventargs E)
{
Properties. settings. Default. Save ();
}
}
}

Depressed, my blog has a bug.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.