Is there a way to change winform shortcut names at the same time?

I have a form with about ~ 400 labels with random names like "1", "00a", "241c", "1251", etc. I want to give them new names that are incrementing, for example "lbl001", 'lbl002', 'lbl003' ...

Changing them manually takes a few seconds for each of them. Is there a way to speed it up or process all of them at once?

+4
source share
1 answer

You can create a script to iterate over all label declarations in Form.Designer.cs and replace each name it finds with a loop counter value + prefix.

You can find Label declarations using regular expressions, and then iterate over the hit list.

+3
source

All Articles