我可以创建一个坐在旁边的在Visual Studio中了.Designer.cs文件的文件? [英] Can I create a file that sits next to a .Designer.cs file in Visual Studio?

查看:207
本文介绍了我可以创建一个坐在旁边的在Visual Studio中了.Designer.cs文件的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中,当你创建一个新的Windows窗体在解决方案(例如,如果您创建MyForm.cs,MyForm.Designer.cs和MyForm.resx还创建)创建两个文件。这些第二两个文件显示在Solution Explorer中的子树。

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 created). These second two files are displayed as a subtree in the Solution Explorer.

有没有办法将文件添加到该子树或组Windows窗体类?

推荐答案

在编辑模式下打开.csproj的,找你想成为下一个又一个文件,并添加DependentUpon元素,像这样的:

Open .csproj in edit mode, look for the file you want to be under another one, and add the DependentUpon element, like this:

<Compile Include="AlertDialog.xaml.cs">
  <DependentUpon>AlertDialog.xaml</DependentUpon>
</Compile>

这篇关于我可以创建一个坐在旁边的在Visual Studio中了.Designer.cs文件的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆