I suggest to use Application Settings:
- Select checkbox in designer
- Go to properties and select (ApplicationSettins)
- Go to Checked, click on its value and select new
- Add new application setting scoped to user
That will generate code which loads setting from file and adds binding to Checked
property of checkbox (that will load property value from settings file during form creation and update settings file when it checkbox Checked
property value will be changed):
this.capitalizeStringsCheckBox.Checked = global::WindowsFormsApplication.Properties.Settings.Default.CapitalizeStrings;
this.capitalizeStringsCheckBox.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::WindowsFormsApplication.Properties.Settings.Default, "CapitalizeStrings", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));