怎么关联两个文件? 新建一个Windows窗体应用程序,可以见到Form1.cs和Form1.Designer.cs在“树形框”里是有父子关系的,即Form1.cs可以展开,看到Form1.Designer.cs。问:我现在有两个代码文件A和B,怎么做能使得A与B产生父关系,例如A是B的父级。即A可以展开,看到B。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1、关闭项目2、用notepad手动打开你的项目文件,即那个类似WindowsFormsApplication1.csproj的文件。3、找到包含B.cs的项目,类似: <Compile Include="B.cs" />4、修改添加一个<DependentUpon>项,结果类似: <Compile Include="B.cs"> <DependentUpon>A.cs</DependentUpon> </Compile>5、保存并重新打开项目。 我再补充一下,如果文件是在某个文件夹里面,应该直接DependentUpon文件名,而不带路径。 <Compile Include="Fundamental\Album.cs" /> <Compile Include="Fundamental\Album.Contract.cs"> <DependentUpon>Album.cs</DependentUpon> </Compile> windows应用程序 窗口突然关闭,没有引发任何异常 扇形统计图 如何用c#直接创建个简单的.x模型 数据库连接字符串加密,大家用的什么加密技术? 如何从sql2000中导出image类型图片到硬盘上? 北大青鸟笔试题 WinForm中如何让Datagrid的某一列不能自动排序 救命啊,不然就死定了 C#引用了外部dll,脱离编译环境便不能运行,如果不做成安装包,该怎么解决? 如何捕获COM异常 Winform 有没有类似于petshop那样的源码 两个窗体之间的互相跳转
2、用notepad手动打开你的项目文件,即那个类似WindowsFormsApplication1.csproj的文件。
3、找到包含B.cs的项目,类似: <Compile Include="B.cs" />
4、修改添加一个<DependentUpon>项,结果类似: <Compile Include="B.cs">
<DependentUpon>A.cs</DependentUpon>
</Compile>5、保存并重新打开项目。
<Compile Include="Fundamental\Album.cs" />
<Compile Include="Fundamental\Album.Contract.cs">
<DependentUpon>Album.cs</DependentUpon>
</Compile>