I accidentally added some.cs files to project as Form instead of Class. Now in Solution Explorer they keep showing up as Form with Form icon (and opening Designer as default).
How can i change them to class type?
<Compile>
element that refers to your C# file<SubType>
subelement (or change its content from Form
to Code
)Just create a new class file and copy+paste the code over. Remove the inheritance from Form, too.
If you want to preserve your SVN history try:
Form
and all cruft like initialize component in your constructor You could delete the Form class's designer.cs
. Then remove inheritance from Form
and InitializeComponets() call.
In *.csproj file , find the form name
and replace respective <SubType>Form</SubType>
element.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.