Reputation: 3826
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?
Upvotes: 4
Views: 2786
Reputation: 121
My help was that the form has to be the first class in the file. No classes above!
Upvotes: 0
Reputation: 191
Simply select the form and press Shift+F7. You'll find your form.
Upvotes: -1
Reputation: 11
remove the reference of form related dll and again add and build the project
Upvotes: 1
Reputation: 1071
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.
Upvotes: 7
Reputation: 11216
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
Upvotes: 1
Reputation: 6665
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.
Upvotes: 1
Reputation: 115877
Press F7 when in code editor to get to the designer. And restarting Visual Studio usually helps.
Upvotes: 0