简体   繁体   English

如何更改新组件的默认名称

[英]How to change the default name of new components

Delphi sets the name of components when you add them to a form. Delphi 在将组件添加到表单时设置它们的名称。 The first TButton will be named "Button1" the second "Button2" and so on.第一个 TButton 将命名为“Button1”,第二个将命名为“Button2”,依此类推。

A while ago I discovered by accident that you can change this "prefix".前一阵子我偶然发现你可以改变这个“前缀”。 Staying with TButton I changed it to "btn" so TButtons will be named "btn1", "btn2" and so on.继续使用 TButton,我将其更改为“btn”,因此 TButton 将被命名为“btn1”、“btn2”等等。

Now I want to change some more component prefixes but unfortunately I forgot how to do this.现在我想更改更多组件前缀,但不幸的是我忘记了如何执行此操作。 It could be some functionality of GExperts.它可能是 GExperts 的一些功能。 Anybody to the rescue?有人来救援吗?

Just if it is important: I'm using Delphi 10.2.如果它很重要:我使用的是 Delphi 10.2。

In GExperts it's called "Rename Components": http://www.gexperts.org/tour/index.html?renamecomponents.html在 GExperts 中,它被称为“重命名组件”: http://www.gexperts.org/tour/index.html?renamecomponents.ZFC35FDC70D5FC69D2698Z83A822C7A5E3

To get there you have to open "GExperts Configurations" and click on "Configure" button at the right side of "Rename Components": http://www.gexperts.org/tour/index.html?gexperts_configuration.html To get there you have to open "GExperts Configurations" and click on "Configure" button at the right side of "Rename Components": http://www.gexperts.org/tour/index.html?gexperts_configuration.html

There is the same functionality in CnPack in "Prefix-master" “Prefix-master”中的 CnPack 也有同样的功能

I can be wrong a little, because I prefer CnPack, but they are similar enough, I think.我可能错了一点,因为我更喜欢 CnPack,但我认为它们足够相似。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM