我在C#中用partial把类分成文件,却没法像Form1.cs  Form1.designer.cs 那样显示出来,依旧在一个文件中  ,该如何操作~~~?

解决方案 »

  1.   

    "却没法像Form1.cs Form1.designer.cs 那样显示出来,依旧在一个文件中"
    什么意思??
      

  2.   

    Form1.designer.cs 是Form1.cs 的一个子菜单,而自己建的在外面,拖不进去
      

  3.   

    那你建一个form,然后把里面的东西全改成你的类不就可以了?
      

  4.   

    通用的解决方法就是,直接改.csproj文件,你要想让file1在file2下面,就在include file1的时候加一个DependentUpon
    比如加了一个Class1.cs,让它在Form1.cs的下面<Compile Include="Class1.cs" >
    <DependentUpon>Form1.cs</DependentUpon>
    </Compile>