Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Rapid Application Development with My.Resources and My.Settings 

The My.Resources object provides access to the application's resources and allows you to dynamically retrieve resources for your application.

Retrieving Resources

A number of resources such as audio files, icons, images, and strings can be retrieved through the My.Resources object. For example, you can access the application's culture-specific resource files. The following example sets the icon of the form to the icon named Form1Icon stored in the application's resource file.

Sub SetFormIcon()
    Me.Icon = My.Resources.Form1Icon
End Sub

The My.Resources object exposes only global resources. It does not provide access to resource files associated with forms. You must access the form resources from the form. For more information, see Walkthrough: Localizing Windows Forms.

Similarly, the My.Settings object provides access to the application's settings and allows you to dynamically store and retrieve property settings and other information for your application. For more information, see My.Resources Object and My.Settings Object.

See Also

Community Additions

© 2015 Microsoft