惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
腾讯CDC
博客园 - Franky
Engineering at Meta
Engineering at Meta
C
Check Point Blog
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学

博客园 - 萝卜青菜

.Net2.0在程序中编译代码 - 萝卜青菜 - 博客园 C#利用VB的My功能来显示文件拷贝、删除、移动进度 - 萝卜青菜 - 博客园 .net2.0提供的TextBox候选文字提示功能 .net2.0轻松判断NumLock、CapsLock、ScrollLock、Insert键的状态:) .net2.0轻松取得应用程序图标 利用System.Media来做声音提醒 .net2.0中改变数组大小 将窗体或窗体上某控件保存为图片 让窗体关闭按钮无效新法 ClickOnce部分信任文件达到一定大小怎么办?(技巧) 页面根据不同Url显示不同Title以及不同的Mete 新增的Application.OpenForms属性 全屏显示一个图片文件 使用静态类来简化单件 新的两道面试题(简单) 求问模式达人,静态类可否代替单件? 使Div内内容可编辑:) GridView&DetailsView对XML文件增删改 对象池及数据库连接对象池
.net2.0窗体关闭时自动保存窗体位置及大小
萝卜青菜 · 2006-07-22 · via 博客园 - 萝卜青菜

.net2.0为我们准备好了。
窗体属性中 (ApplicationSettings) - (PropertyBinding) 点击按钮。
点开Location新建,输入自己的设置名称,我设置的是MyLocation。
同样也新建一个MyClientSize,然后OK。
再打开您的Project属性里面的设定选项卡,看到我们刚才的MyLocation,MyClientSize。
然后看代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace SaveWindowSizeAndLocation
{
    
public partial class Form1 : Form
    {
        
public Form1()
        {
            InitializeComponent();
        }
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            Properties.Settings.Default.Save();
        }
    }
}

郁闷,我的博客出了BUG。