Rename a file

Page update date :
Page creation date :

substance

To rename a file that you've added to your project, open a Solution Explorer window and select the file you want to rename.

Please note that if you rewrite the file name directly in Windows Explorer, etc., it will not be recognized by the project.

There are several ways to change the file name, but if you select the file and click it again with the mouse, it will be in the text input state as shown on the right.

You can also press the "F2" key on your keyboard to get to a similar state.

If you right-click the file and select "Rename" from the menu that appears, you will be switched to the input state in the same way.

You can change the file name by entering text in this state. However, do not change the extension unless necessary.

If the file name is changed, a dialog similar to the one shown in the figure may be displayed. If the file name matches the class name in the source code, you can change the class name as well.

If you also want to change the class name, select "Yes".

If you look at the source code, you can see that the class name has changed. By the way, if the target class is also used in other source code, all of those classes will be renamed. (Same behavior as renaming a refactor)