0

Last post 2008???!!! So, I guess I won't expect much in 2014...

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?

4
Contributors
3
Replies
21
Views
3 Years
Discussion Span
Last Post by JOSheaIV
0

Change the name using the properties for the control. Right-click the control, and select "Properties". Look for "(Name)". Change the name there.

0

If you are using Visual Studio, and in the Designer, you can simply change the Name in the controls properties. Doing so will update all the fields that are causing errors.

(however, if you can't, then you simply need to edit the values related to it within the designer file (the code part), and then anywhere else used).

The first way is very easy (only thing that sucks is events won't get renamed if a they contain a match to the old name)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.