简体   繁体   中英

VS2010 Custom Settings Class Editor

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

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;
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM