Thanks for your help...I have another question
What do you mean by change Settings to the base indexer? Change it similarly to MyUserSettings? VS2005 generated a Settings class when I added the application setting for BackColor... I've made some notes in the code below in red
//---------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//----------------------------------------------------------------------
namespace WindowsApplication1 {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("255, 224, 192")]
public global::System.Drawing.Color BackColor {
get {
return ((global::System.Drawing.Color)(this["BackColor"]));
//Should the be:
//return ((global::System.Drawing.Color)base["BackColor"]);
}
set {
this["BackColor"] = value;
//And this
//base["BackColor"] = value;
}
}
}
}
Either way (with or without the changes in red above) I get the following error when I continue with the example code shown below
ERROR: Cannot bind to the property 'BackgroundColor' on the target control.
Parameter name: PropertyName
CODE:
public Form1()
{
InitializeComponent();
MyUserSettings myUserSettings = new MyUserSettings();
this.DataBindings.Add(new Binding("BackgroundColor", myUserSettings, "BackColor"));
}