renaming Form1

  • Thread starter Thread starter Tim923
  • Start date Start date
T

Tim923

There seem to be 4 steps to rename the form Form1 to MyForm:

Rename the CS file from Form1 to MyForm. (I think this step could be
ommitted, but they might deduct points.)

Click on the form and then go to the properties section. In the
(name) section, enter MyForm. In the text section, enter "This is my
form" or MyForm or whatever.

Compile to see where the error is. Change Form1 to MyForm.

Is there a better way?

-
http://mysite.verizon.net/vze8adrh/news.html (profile) --Tim923 My email is valid.
 
You've seemed to hit it squarely on target! The
generated code is definetely a real bite when it comes to
renaming one of the objects in the project.
 
Tim923 said:
There seem to be 4 steps to rename the form Form1 to MyForm:

Rename the CS file from Form1 to MyForm. (I think this step could be
ommitted, but they might deduct points.)

Click on the form and then go to the properties section. In the
(name) section, enter MyForm. In the text section, enter "This is my
form" or MyForm or whatever.

Compile to see where the error is. Change Form1 to MyForm.

Is there a better way?

-
http://mysite.verizon.net/vze8adrh/news.html (profile) --Tim923 My email is valid.

I tend to do it this way :

(1) Rename the .cs file.
(2) Go to the .cs file, and hit Ctrl+M Ctrl+L. This expands all the regions.
(3) Find and replace Form1 to your new name.
(4) Right click on the project in the solution and go to properties.
(5) In StartupObject drop it down and select the name of your form.

David.
 
Back
Top