Thursday, May 29, 2008

Renaming "Form1"

Visual Studio should really allow you to change the name of the startup form on creation of a new project, or at least have a more descriptive name, such as (ProjectName)Main. However, they don't do this, and you're stuck with the entirely bland and nondescript Form1.

There is a way around this though: it's still much easier to do this right after you create the project rather than a long time down the road, but here it is:

-Rename the filename of the main form (Form1.cs, Form1.h, etc).
-Press Ctrl+H (brings up Quick Replace menu)
-Change "Look in" to "Entire Solution" (not just that file)
-Find "Form1", replace with the new name you've chosen.

No comments: