title: A partial class has multiple form
body: <p>When I write a winforms application, I tend to create an <em>Implementation.cs</em> file for each form.</p>
  <p>Say I have <em>Form1.cs</em>, I'd create a new file called <em>Form1.Implementation.cs</em> starting with <code>partial class Form1</code>.</p>
  <p><em>Form1.cs</em> just contains all the event callback methods (what the designer has done), everything else goes to <em>Form1.Implementation.cs</em>. It helps me write more readable code.</p>
  <hr />
  <p>I wanted <em>Form1.Implementation.cs</em> to be a &quot;subfile&quot; just like <em>Form1.Designer.cs</em> is, so I edited <em>.csproj</em> file.</p>
  <pre><code>&lt;Compile Include=&quot;Form1.Implementation.cs&quot;&gt;
      &lt;DependentUpon&gt;Form1.cs&lt;/DependentUpon&gt;
  &lt;/Compile&gt;
  </code></pre>
  <p>After reload, however, <em>Visual Studio</em> automatically adds <code>&lt;SubType&gt;Form&lt;/SubType&gt;</code> right after <code>DependentUpon</code> element. Doubleclicking <em>Form1.Implementation.cs</em> doesn't show code but a designer with another initial empty form.</p>
  <p>It's like</p>
  <blockquote>
  <p>&quot;class <em>Form1</em>, which ISA <em>Form</em>, is(?) multiple forms.&quot;</p>
  </blockquote>
  <p>I tried <a href="https://stackoverflow.com/a/2139078/1986241">adding <code>DesignerCategory</code> attribute</a> to class <em>Form1</em>, but it affects <em>Form1.cs</em>, as well.</p>
  <p>Well, hitting 'Shift-F7' or 'Ctrl-Shift-0' is not a big deal.
  I wonder if...</p>
  <ol>
  <li>it's a glitch of <em>Visual Studio</em>,</li>
  <li>the secondary(?) form really exists somehow,</li>
  <li>it's going to blow up my winforms project someday</li>
  </ol>