Renaming WinForms in VC++

  • Thread starter Thread starter Joe Thompson
  • Start date Start date
J

Joe Thompson

Hi,

I am almost embarrassed to ask this but I can't figure out how to rename a
form (and it's file) in VC++. I don't like being stuck witht the main form
called Form1. I'm sure it must be obvious but it looks like the name is
read-only in the property view.

Thanks,
Joe
 
Joe said:
Hi,

I am almost embarrassed to ask this but I can't figure out how to
rename a form (and it's file) in VC++. I don't like being stuck
witht the main form called Form1. I'm sure it must be obvious but it
looks like the name is read-only in the property view.

Amazingly, there's no facility to do this. IMO your best bet is when you
create a new project, immediately delete Form1 and create a new form with a
more sensible name.

For an existing project, you have to go manually rename the form in a bunch
of places - tedious and error prone, but it can be done.

-cd
 
Hi,

Thanks for the reply. When you say to "immediately delete Form1", how do
you do this? I tried deleting the form1.cpp and form1.h files from the file
view, added a new winform called MainForm and compiled but I got an
unresolved external symbol _WinMain@16. What am I doing wrong?

Thank you,
Joe
 
Joe said:
Hi,

I am almost embarrassed to ask this but I can't figure out how to rename a
form (and it's file) in VC++. I don't like being stuck witht the main form
called Form1. I'm sure it must be obvious but it looks like the name is
read-only in the property view.

I haven't had any trouble doing the following (routine now)
1. left click on file (Form1.cs) in solution explorer and hit F2 to
rename the file.
2. in the file do a change of Form1 to xxxx
3. Change the AssemblyInfo version to remove the *.*

#3 isn't needed to solve your problem but it prevents clogging the
download cache every time it's run..

/steveA
 
Back
Top