Skip to content

Latest commit

 

History

History
37 lines (32 loc) · 2.25 KB

File metadata and controls

37 lines (32 loc) · 2.25 KB
title How to: Read Application Settings in Visual Basic
ms.custom
ms.date 07/20/2015
ms.prod .net
ms.reviewer
ms.suite
ms.technology
devlang-visual-basic
ms.topic article
helpviewer_keywords
reading application settings
My.Settings object [Visual Basic], reading application settings
application settings [Visual Basic], reading
ms.assetid eb3428ef-115e-49a8-a878-e0613183fee0
caps.latest.revision 12
author dotnet-bot
ms.author dotnetcontent

How to: Read Application Settings in Visual Basic

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.

[!code-vbVbVbalrMyResources#14]

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

See Also

My.Settings Object
How to: Change User Settings in Visual Basic
How to: Persist User Settings in Visual Basic
How to: Create Property Grids for User Settings in Visual Basic
Managing Application Settings (.NET)