views:

1141

answers:

4

Hi,

So I have an existing project with a custom tab control nested within panels and splitters etc.

Now I need to add something to one of the pages of this tab control through the design view.

However, when I view the form in question, the tab control is nowhere to be seen (and not in the drop down of current controls on the page).

The tab control is in the designer code and appears when you run.

Any advice for this probably noob question?

Edits

Okay, I probably should have mentioned this but I guess I forgot - the form is an inherited form. Some of the differences of this form from the inherited form are present, but not the tab control

+2  A: 

Check if this feedback article matches your problem.

Hans Passant
Possibly to some degree - I just can't see any of the tab control though. I'll try some closing/rebuilding combinations and see what I can make happen - thanks :-)
Graphain
Couldn't manage to fix it :-(
Graphain
Yes. This happens to me on VS2005. Workaround by closing the designer and re-opening.
dotjoe
Tried. Also tried opening the code in a different Visual Studio instance.
Graphain
A: 

Have you tried adding a tab with some content to it? Sometimes the designer doesn't like to show you something that hosts content when there isn't any content to host.

Ken Wootton
The tab control had several tabs full of controls but all of it is now invisible..
Graphain
+2  A: 

The tab control is probably Private in the base form. Try to set the Modifier property of the tab control to Protected or Public (from the designer of the base form).

If the control field is private it wont be available in the designer of inheriting forms, but it will still show up at runtime.

Update, new question by author

I dont know how it happened without somebody editing the csproj file in a text editor. But this example shows how a form include should look in the csproj.

<Compile Include="MainForm.cs">
  <SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.designer.cs">
  <DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="MainForm.resx">
  <DependentUpon>MainForm.cs</DependentUpon>
  <SubType>Designer</SubType>
</EmbeddedResource>

This example will cause the behavior you described. (DependentUpon-tags removed).

<Compile Include="MainForm.cs">
  <SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.designer.cs"/>
<EmbeddedResource Include="MainForm.resx">
  <SubType>Designer</SubType>
</EmbeddedResource>
Mikael Sundberg
Thanks for the input - don't think it was this particular problem but I appreciate the help nonetheless :-)
Graphain
Okay thanks for the update - I'm giving you the bounty for your efforts :-)
Graphain
A: 

So..

I noticed that the .designer, .resx and form class code were all listed as separate files in Visual Studio (not automatically joining).

I have no idea what caused this and reverting source code + project didn't help.

However.. I decided to do what I should have done much earlier which was save the 3 files separately, remove them all through the Visual Studio interface, save the project, move the 3 files back and add them as existing items, before saving and rebuilding everything. After all this everything is fine again...

If anyone has a good idea why the three files separated I'll award the bounty there :-)

Thanks also for all the feedback above :-)

Graphain
Good to hear that you solved your problem. Updated my answer with an description of how you could cause the behavior you described. But I don't know how it can happen without editing the csproj-file.
Mikael Sundberg