Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual C# "Settings Editor" within application?

Tags:

c#

.net

settings

Is there an easy way to wrap a "Preferences Panel" thing around the Settings.settings file (or any other settings file)?

Basically I have a bunch of strings stored in Settings.settings, and want to have a form where the user can edit these..

I could add a bunch of TextBoxes, and have a button that does Properties.blah = this.blahInput.Text; Properties.Save(); for each, but this feels like reinventing the wheel..

Edit: The PropertyGrid control (as suggested by bassfriend's) seems perfect, but I cannot work out how to bind the property grid's SelectedObject to Properties.Settings.Default - When I try I get the following error:

Cannot implicitly convert type 'MyProject.Properties.Settings' to 'object[]'
like image 770
dbr Avatar asked May 10 '09 21:05

dbr


People also ask

Is Visual C necessary?

We don't recommend that you delete any Visual C++ redistributable, because doing so could make multiple applications on your computer stop working. Given how little space they take up and how broadly they are used, it doesn't seem worth the hassle to mess with your current ecosystem of standard library files.

Is Visual C free?

A fully-featured, extensible, free IDE for creating modern applications for Android, iOS, Windows, as well as web applications and cloud services.

Is Visual Studio C or C++?

C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS.

What is Visual C runtime?

The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries. These libraries are required by many applications built by using Microsoft C and C++ tools.


2 Answers

Maybe you want to take a look at the PropertyGrid Control.

like image 153
ba__friend Avatar answered Sep 21 '22 23:09

ba__friend


I had no problem:

        propertyGrid1.SelectedObject = Properties.Settings.Default;

I did have to change the visibility to Public in the Settings Designer.

like image 42
John Saunders Avatar answered Sep 20 '22 23:09

John Saunders