我的自定义网格控件有许多应用程序设置(在用户范围内)。其中大部分是颜色设置。我有一个表单,用户可以在其中自定义这些颜色,我想添加一个按钮来恢复默认颜色设置。如何读取默认设置?
例如:
- 我有一个名为
CellBackgroundColorin的用户设置Properties.Settings。 - 在设计时,我将值设置
CellBackgroundColor为Color.White使用 IDE。 - 用户在我的程序中设置
CellBackgroundColor为。Color.Black - 我用 保存设置
Properties.Settings.Default.Save()。 - 用户点击
Restore Default Colors按钮。
现在,Properties.Settings.Default.CellBackgroundColor返回Color.Black。我怎么回去Color.White?