windows 如何在 Visual Studio 中重命名资源?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5137800/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:18:02  来源:igfitidea点击:

How to rename a resource in Visual Studio?

c++windowsvisual-studioresources

提问by Thomas Bonini

Okay, I've never done win32 programming before, and I have a question that seems fairly stupid..

好吧,我以前从未做过 win32 编程,我有一个看起来很愚蠢的问题。

enter image description here

在此处输入图片说明

How do I rename IDR_MENU1to, for example, IDR_MAIN_MENU? I tried everything couldn't find a way.

IDR_MENU1例如,我如何重命名为IDR_MAIN_MENU?我尝试了一切都找不到方法。

回答by santiagoIT

You can modify the resource if you select your resource, example IDR_MENU1 in resource view. Activate the property palette (Ctrl +W, P) and you can then edit the IDR_MENU1 value.

如果选择资源,则可以修改资源,例如资源视图中的 IDR_MENU1。激活属性选项板 (Ctrl +W, P),然后您可以编辑 IDR_MENU1 值。

回答by Dave D.

This is from 2011, but I didn't see a good answer.

这是 2011 年的,但我没有看到好的答案。

Here is one easy way to rename IDR_MENU1 to another name. Select IDR_MENU1, then hit ALT + ENTER. This will show the 'Properties' window. Here you can rename IDR_MENU1 under 'Id'.

这是将 IDR_MENU1 重命名为另一个名称的一种简单方法。选择 IDR_MENU1,然后按 ALT + ENTER。这将显示“属性”窗口。您可以在此处重命名“Id”下的 IDR_MENU1。

回答by noops

Exit Visual Studio and then edit the DbcEditor.RCfile. And replace all occurrences of IDR_MENU1with whatever you want.

退出 Visual Studio,然后编辑DbcEditor.RC文件。并用IDR_MENU1您想要的任何内容替换所有出现的内容。