tags:

views:

116

answers:

4

I have a form in my project that is showing up as a class in Solution Explorer. This is causing a problem since I can't get to the designer. Any ideas on how to fix this?

A: 

Press F7 when in code editor to get to the designer. And restarting Visual Studio usually helps.

Anton Gogolev
F7 didn't bring up the designer and I've restarted Visual Studio but still the form shows up as a class instead of a form and I can only get to the code behind. Like a form it still has a .Designer.cs and a .resx.
norlando02
A: 

Try seeing if there are any hidden files by using the the 'Show All Files' button. Sounds like your project file might not have all of the files added to it.

jwarzech
A: 

One thing that has worked for me in the past is to just add another blank form to the project and that seemed to make the other form show up as a form. You can then delete the blank form.

I don't know if it will work for you, but it only takes a few moments to try it.

Chris

Chris Dunaway
+2  A: 

You can fix the problem manually by editing your csproj file.

Open it in notepad and search for the filename of the class. You should see something like this...

<Compile Include="frmTest.cs" />

Add a subtype called 'Form' like this...

<Compile Include="frmTest.cs">
    <SubType>Form</SubType>
</Compile>

Reload the project. Visual Studio should now identify the file correctly.

Craig T