You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Viewing and Editing Resources in a Resource Editor (C++)
9
9
10
10
Each resource type has a **Resource** editor specific to that resource type. You can rearrange, resize, add controls and features, or otherwise modify aspects of a resource using the associated editor. You can also edit a resource in [text format](../windows/how-to-open-a-resource-script-file-in-text-format.md) and [binary format](../windows/opening-a-resource-for-binary-editing.md).
11
11
12
-
Some resource types are individual files that can be imported and used in various ways; these include bitmaps, icons, cursors, toolbars, and html files. Such resources have file names as well as[resource identifiers](../windows/symbols-resource-identifiers.md). Others, such as dialogs, menus, and string tables in Win32 projects, exist only as part of a resource script (.rc) file or resource template (.rct) file.
12
+
Some resource types are individual files that can be imported and used in various ways; these include bitmaps, icons, cursors, toolbars, and html files. Such resources have file names and[resource identifiers](../windows/symbols-resource-identifiers.md). Others, such as dialogs, menus, and string tables in Win32 projects, exist only as part of a resource script (.rc) file or resource template (.rct) file.
13
13
14
14
> [!NOTE]
15
15
> Properties of a resource [can be modified using the Properties window](../windows/changing-the-properties-of-a-resource.md).
@@ -22,14 +22,14 @@ You can access Win32 resources in the [Resource View](../windows/resource-view-w
22
22
23
23
1. Select **Resource View** from the **View** menu.
24
24
25
-
2. If the **Resource View** window is not the top-most window, click the **Resource View** tab to bring it to the top.
25
+
1. If the **Resource View** window isn't the top-most window, select the **Resource View** tab to bring it to the top.
26
26
27
-
3. From **Resource View**, expand the folder for the project that contains resources you want to view. For example, if you want to view a dialog resource, expand the **Dialog** folder.
27
+
1. From **Resource View**, expand the folder for the project that contains resources you want to view. For example, if you want to view a dialog resource, expand the **Dialog** folder.
28
28
29
29
> [!NOTE]
30
30
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
31
31
32
-
4. Double-click the resource, for example, **IDD_ABOUTBOX**.
32
+
1. Double-click the resource, for example, **IDD_ABOUTBOX**.
33
33
34
34
The resource opens in the appropriate editor. For example, for dialog resources, the resource opens inside the **Dialog** editor.
35
35
@@ -46,24 +46,80 @@ You can access Win32 resources in the [Resource View](../windows/resource-view-w
46
46
47
47
## Resources in Managed Projects
48
48
49
-
Because managed projects do not use resource script files, you must open your resources from **Solution Explorer**. You can use the [Image editor](../windows/image-editor-for-icons.md) and the [Binary editor](binary-editor.md) to work with resource files in managed projects. Any managed resources you want to edit must be linked resources. The Visual Studio resource editors do not support editing embedded resources.
49
+
Because managed projects don't use resource script files, you must open your resources from **Solution Explorer**. You can use the [Image editor](../windows/image-editor-for-icons.md) and the [Binary editor](binary-editor.md) to work with resource files in managed projects. Any managed resources you want to edit must be linked resources. The Visual Studio resource editors don't support editing embedded resources.
50
50
51
-
For information on adding resources to managed projects, please see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
51
+
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
52
52
53
53
### To view a managed resource in a resource editor
54
54
55
-
1.In **Solution Explorer**, double-click the resource, for example, **Bitmap1.bmp**.
55
+
In **Solution Explorer**, double-click the resource, for example, **Bitmap1.bmp**.
56
56
57
57
The resource opens in the appropriate editor.
58
58
59
59
### To delete an existing managed resource
60
60
61
-
1. In **Solution Explorer**, right-click the resource you want to delete and choose **Delete** from the shortcut menu.
61
+
In **Solution Explorer**, right-click the resource you want to delete and choose **Delete** from the shortcut menu.
62
+
63
+
## Changing the Properties of Resources
64
+
65
+
### To edit the properties of a resource
66
+
67
+
1. In [Resource View](../windows/resource-view-window.md), right-click the resource you want to edit and choose **Properties** from the shortcut menu.
68
+
69
+
> [!NOTE]
70
+
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
71
+
72
+
1. In the [Properties window](/visualstudio/ide/reference/properties-window), change the properties of your resource.
73
+
74
+
### To undo a change made to the properties of a resource
75
+
76
+
1. Make sure your resource has focus in **Resource View**.
77
+
78
+
1. Choose **Undo** from the **Edit** menu.
79
+
80
+
## Previewing Resources
81
+
82
+
Preview your resources to allow you to view graphical resource without opening them. Previewing is also useful for executables after you've compiled them because the resource identifiers change to numbers. Since these numeric identifiers often don't provide enough information, previewing the resources helps you quickly identify them.
83
+
84
+
You can preview the visual layout of the following resource types:
85
+
86
+
- Bitmap
87
+
88
+
- Dialog
89
+
90
+
- Icon
91
+
92
+
- Menu
93
+
94
+
- Cursor
95
+
96
+
- Toolbar
97
+
98
+
The visual preview function doesn't apply to Accelerator, Manifest, String Table, and Version Information resources.
99
+
100
+
### To preview resources
101
+
102
+
1. In [Resource View](../windows/resource-view-window.md) or a document window, select your resource, for example, **IDD_ABOUTBOX**.
103
+
104
+
> [!NOTE]
105
+
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
106
+
107
+
1. In the [Properties window](/visualstudio/ide/reference/properties-window), select the **Property Pages** button.
108
+
109
+
\- or -
110
+
111
+
On the **View** menu, select **Property Pages**.
112
+
113
+
The **Property Page** for the resource opens displaying a preview of that resource. You can then use the **Up** and **Down** arrow keys to navigate the tree control in **Resource View** or the document window. The **Property Page** will stay open and show any resource that has focus and can be previewed.
114
+
115
+
> [!NOTE]
116
+
> To preview resources requires Win32.
62
117
63
118
## Requirements
64
119
65
120
None
66
121
67
-
## See Also
122
+
## See also
68
123
124
+
[How to: Open a Resource Script File Outside of a Project (Standalone)](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)<br/>
0 commit comments