Where are settings values stored for a Windows forms application?

240 Views Asked by At

I have a Windows forms application. When I view settings on the Settings tab of my project properties and when I look at App.config, I see one set of values. When I view the values for some of the properties in a message box in the main form's New subroutine, I see different values. I have no idea where these different values are coming from. Any ideas where else to look for property values that would be overriding what's in App.config? Thanks!

2

There are 2 best solutions below

0
On

I found this after coming here: https://learn.microsoft.com/en-us/dotnet/visual-basic/developing-apps/programming/app-settings/how-to-read-application-settings

You can read a user setting by accessing the setting's property on the My.Settings object.

The My.Settings object exposes each setting as a property. The property name is the same as the setting name, and the property type is the same as the setting type. The setting's Scope indicates if the property is read-only; the property for an Application scope setting is read-only, while the property for a User scope setting is read-write. For more information, see My.Settings Object.

Example This example displays the value of the Nickname setting.

    Sub ShowNickname()
        MsgBox("Nickname is " & My.Settings.Nickname)
    End Sub

For this example to work, your application must have a Nickname setting, of type String. For more information, see Managing Application Settings (.NET).

0
On

do you try checking on the app.config <add name="pointername" (name) and compare to properties.settings? it should be the same with the app.config.