Beginner Having Trouble Renaming Controls

BullFrogBullFrog San Diego, California

In VB, I would change the name of controls often. I'd start with textBox1 and later change it to txtInput or whatever. C# doesn't like this. When I do this, I get errors that the control with the old name is missing.

  1. To not go through this, I can get used to naming the control right away, but I'd rather...

  2. Change the name on the fly without the errors. Do I do a global search and replace or a rename or what? What is the easiest way to do this?


  • The easiest way is to refactor the names, refactoring makes sure that in case you have used the name already, that it also updates the places where it founds the old name and replaces it with the new name.

    C# & normally handle this in the same way, if you change the name inside the properties, it should also update all references found with this name

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion