LocationMy.Resources DescriptionUse the My.Resources object to access the global culture-specific resources for the active application. Resources are initially managed in Visual Studio using the new Resources panel of the project's Properties window. (Access this window by double-clicking on the "My Project" item in the Solution Explorer or by selecting Properties from Visual Studio's Project menu.) This form lets you add resources to a project, including named strings, images, icons, and other file-based resources. You can also add file-based resources to the project as standard items in the Solution Explorer. All added resources are defined through the project's Resources.resx (or similar) resource file. To support the features required by My.Resources, Visual Studio also creates a separate Resources.Designer.vb file. This file includes standard Visual Basic source code that provides property-based retrieval of resources from the project's resource file. As resources are added to a project, they are dynamically added as properties in the My.Resources object. For example, if you add a string resource named ConfirmDataDelete, it can be accessed in your code as: My.Resources.ConfirmDataDelete and it will be strongly typed as a String. For those resources added as file items to the project, the resource is referenced as: My.Resources.resourceFile.resourceName All resource properties available through My.Resources are read-only. My.Resources uses the resources associated with the My.Application.CurrentUICulture culture, although you can override this default and use a different culture. Public MembersEach resource added to your project becomes a property in the My.Resources object. In addition to these, there are two members used to manage access to the resources.
Usage at a GlanceOnly application-wide resources are accessible through My.Resources; form-level resources (often used for culture-specific labels) are not available through this object. Related Framework Entries
See AlsoForms Object, My Namespace, ChangeUICulture Method, Settings Object, UICulture Property, WebServices Object |