因此,当我抓取不同解决方案的一些文件并将它们粘贴到不同的解决方案中时,我的 Mainform 和设计师分离了。如果我运行我的程序,表格会正确显示,但是当我在设计模式下查看我的表格时,它是一个空白表格。任何人都知道如何重新连接设计器?
感谢您的帮助。
最佳答案
使用文本编辑器(记事本很好)编辑 .csproj 文件以添加缺失的 <DependentUpon>
元素。所以它看起来像这样:
<Compile Include="Yadayada.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Yadayada.Designer.cs">
<DependentUpon>Yadayada.cs</DependentUpon>
</Compile>
关于c# - 将 Designer.cs 重新附加到 mainform.cs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21191985/