views:

72

answers:

2

I have a VS 2008 Winforms project, and I recently added an existing form that was developed in a different VS 2008 project. All of the original forms and controls are nesting correctly, however, with the new form, it is showing the form, designer and resx files as 3 separate items.

Is there a way to force VS to nest these files properly? I've been through the settings, googled, been to MSDN, and can't seem to find information on this.

TIA.

+2  A: 

Assuming the new form is called "Form1" should look like this for it:

<Compile Include="Form1.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Form1.Designer.cs">
      <DependentUpon>Form1.cs</DependentUpon>
    </Compile>
    <EmbeddedResource Include="Form1.resx">
      <DependentUpon>Form1.cs</DependentUpon>
    </EmbeddedResource>
VoodooChild
So I should just edit the project file manually? I can see that the sub files have no "DependentUpon" attribute.
Jeremy
Thank you. That solved it!
Jeremy
Yup, you got it!
VoodooChild
+1  A: 

Edit the .csproj file with, say, Notepad. The <DependentUpon> elements are missing.

Hans Passant
Thanks! +rep but Voodoo was faster.
Jeremy