Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Beginner Having Trouble Renaming Controls

BullFrogBullFrog San Diego, CaliforniaPosts: 0Member

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?

Comments

  • IcepickleIcepickle GermanyPosts: 48Member

    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# & Vb.net 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.