Reputation: 790
I have a custom settings class (inheriting from ApplicationSettingsBase) and I wish to replicate the functionality of showing a control for the editing of that class. How do I do this, as I can't find anywhere that will show me?
I have spent a long time searching but I apologise if the solution is already out there.
Ed
Upvotes: 0
Views: 231
Reputation: 1475
What I do when I want to edit my custom settings at run-time is use a PropertyGrid with the SelectedObject
property set to the name of my class:
public class frmOptions
{
CustomSettings MySettings = new CustomSettings();
private frmOptions_Load(object sender, EventArgs e)
{
PropertyGrid1.SelectedObject = MySettings;
}
}
Upvotes: 1