Visual Studio forms designer

This will occur if the first class in the source file is NOT the "partial class" for your form. In this case the file type icon in solution explorer will initially display as a form but VS will change it to the "C#" code icon after it has loaded the file and also remove the "View Designer" option from the popup menu. At least in VS2015 this can be fixed by commenting out the offending code and saving the file at which time VS will restore the expected form icon.


I've had this problem too, i've modified the .csproj file to fix it. In my .csproj file i modified this line of code:

<Compile Include="FormName.cs" />

With this code:

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

Your forms are probably inheriting a custom form class.

There may be times when VS doesn't realize that the custom class inherits Form. (eg, if the solution doesn't build).

Try rebuilding the solution.

If you want a more precide answer, please provide more details.