Visual Studio, Application Settings... rearrange
Asked Answered
N

3

24

alt text

Silly questions... purely aesthetic... given the picture above. How do you move the values up/down? For example, State belongs grouped with Height/Width/Top/Left (Window Position + state).

Not the only project where I later add stuff and it slowly gets out of order. Can delete/re-add, but that gets tedious and error prone. Can just leave it as is, but it's a minor annoyance.

Am I totally not seeting the setting somewhere to move the stuff around, because I've looked and I just don't see it.

Newmark answered 30/9, 2010 at 13:47 Comment(2)
For me this is not a purely cosmetic measure. Configuration files often change in our projects, without sorting it would be hard to merge them.Parody
Yeah. For me it's an OCDish desire to categorize and put stuff in the "proper" order.Newmark
T
45

Close the solution. Open the project's Properties\Settings.settings file and re-arrange the <Setting> items. You'll get them back listed in the Settings Designer in the order in which they are listed in that file.

Thomasinathomasine answered 30/9, 2010 at 14:1 Comment(4)
I did that while the solution was open (the .cs file). Didn't think to do it with it closed. I assume you mean in a text editor, not VS.Newmark
Simple. Do you have to re-arrange settings.settings? s.s.cs? both?Newmark
Modify Settings.settings, which will in turn generate Settings.Designer.csConstituency
You may need to right click on the settings.settings file in solution explorer and choose "Run custom tool" to force the settings.designer.cs file to update.Caucasus
T
2

As the other answers indicate you need to edit the sequence of the entries in the Properties\Settings.settings file. You do not need to close VS, just close the Properties tab if it is open.

Also this will not re-arrange the XML entries in you .config file. For that you need to re-arrange the entries in your app.config file, that is created in your root project folder.

Both files are simple XML based files.

Towline answered 4/5, 2016 at 18:50 Comment(1)
For the Settings.settings file, File > Open > File..., Click on "Open with" and select XML editor. If you just open it, it will open just like in Properties and you won't be able to edit it.Littrell
E
0

You can't move things around in that screen. It's loaded and saved by the "natural" order. Meaning that new things are placed at the bottom.

Epiblast answered 30/9, 2010 at 13:49 Comment(2)
I know it's not right to expect Excel type options (Cut/Paste/reorder)... but it seems odd that there is no option at all to move things around, other than delete/re-add.Newmark
The problem is that there are 2 different scenarios. Consider that some people (like me) would prefer those options to be in alpha sort order. Others, like you, want to place them in a particular order. From MS's perspective, they chose option 3: just don't worry about it. Which, from a coding perspective, was the easiest path for them.Epiblast

© 2022 - 2024 — McMap. All rights reserved.