using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;namespace WindowsApplication2
{
    sealed class ProjectSettings : ApplicationSettingsBase
    {
        public ProjectSettings()
        {
            
        }
        [UserScopedSettingAttribute()]
        [DefaultSettingValue("12.5")]
        public double RichTextLeftMargin
        {
            get { return (double)this["RichTextLeftMargin"]; }
            set { this["RichTextLeftMargin"] = value; }
        }
    }
}        ProjectSettings setting = new ProjectSettings();
        private void button1_Click(object sender, EventArgs e)
        {
        
            //读取左边据
            Console.WriteLine("左边距:"+setting.RichTextLeftMargin);        }
        private void button2_Click(object sender, EventArgs e)
        { 
            //改变并保存
            setting.RichTextLeftMargin = 11;
            setting.Save();
        }