.net2.0窗体关闭时自动保存窗体位置及大小

.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。

posted on 2006-07-22 18:02 萝卜青菜 阅读(300) 评论(1) 编辑 收藏

评论

#1楼[楼主]  回复 引用 查看   

.net2.0为我们作了好多:) 感谢。
2006-07-22 18:03 | 萝卜青菜      

导航

<2006年7月>
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

公告

昵称:萝卜青菜
园龄:6年3个月
粉丝:0
关注:0

搜索

 
 

常用链接

随笔分类(55)

文章分类(3)

积分与排名

  • 积分 - 0
  • 排名 - 67422

最新评论

推荐排行榜