Form Naming

sirmilt

Member
Joined
Dec 14, 2006
Messages
17
Programming Experience
1-3
I am using Visual Basic.net 2003.

I changed the name of the default form, in a new program I am working on, from "Form1" to "frmCollections". I made the change in both the Project Explorer and the form's properties.

When I attempt to run the program I am greeted with an error message "There were errors. Continue?" with "Yes" and "No" buttons.

If I click "Yes" the program runs perfectly.

If I click "No" the Task List at the bottom of the form has the entry "Resources 'Form1.resx'. When I right click the error message an look at the solution presented I am asked to change the name, I do so and there are now 2 files with the same name and I get the same error.

If I delete one of the two I still get the same error.

Obviously I'm doing something wrog but I can't figure out what.

Thanks.
 
I resolved the problem byadding a new for with the correct name, copying my code an then deleting the old form from the procedure.

While this solution worked I still don't understand why renaming a form caused all of the problems.
 
The reason it ran OK if you selected to continue is that it was running the old build, which was created before you made the change. It ran then so it runs now, but no changes you've made to the code will be reflected in the running application.

As for what the issue was, I'm not 100% sure but it depends how you made the change. The best way to do it is to right-click the file in the Solution Explorer and rename there, then accept when prompted to rename the class as well. If you didn't do that then it's anyone's guess exactly what the issue was. If you did do that then the issue may well have been the fact that, if you rename your startup form, you still have to go to the project properties and select the newly named form to startup with. That change is not made automatically.
 
Back
Top