Skip to content

Xanliang/SaveFieldsConfigAttribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

SaveFieldsConfigAttribute

Use Attribute Save Form's Control Property To Xml For Windows Form Project Use Visual Studio 2019

(1) using in Form1.Designer.cs

    [SaveFieldsConfig("Text")]
    private System.Windows.Forms.TextBox textBox1;
    [SaveFieldsConfig("Text")]
    private System.Windows.Forms.NumericUpDown numericUpDown1;
    [SaveFieldsConfig("Checked")]
    private System.Windows.Forms.CheckBox checkBox1;
    [SaveFieldsConfig("Checked","Font")]
    private System.Windows.Forms.RadioButton radioButton1;

(2) Save and Load XmlFile

    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
    {
        SaveFieldsConfigAttribute.SaveXmlToFile(this, this.Name + ".xml");
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        SaveFieldsConfigAttribute.LoadXmlFromFile(this, this.Name + ".xml");
    }

Test Demo: image

About

Use Attribute Save Form's Control Property To Xml

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages