Can I create a file that sits next to a .Designer.cs file in Visual Studio?

后端 未结 3 1405
既然无缘
既然无缘 2020-12-19 07:01

In Visual Studio, two files are created when you create a new Windows Form in your solution (e.g. if you create MyForm.cs, MyForm.Designer.cs and MyForm.resx are also create

3条回答
  •  死守一世寂寞
    2020-12-19 07:11

    Yes, but it's a bit of a hassle - basically you need to edit the project file by hand.

    Here's an example from a project that Marc Gravell and I both work on:

    
    
      DataProducerExt.cs
    
    
      DataProducerExt.cs
    
    
      DataProducerExt.cs
    
    
      DataProducerExt.cs
    
    
      DataProducerExt.cs
    
    

    Note the "DependentUpon" element in each of the dependencies. This displays appropriately in VS, with DataProducerExt.cs as the parent.

提交回复
热议问题