views:

103

answers:

1

Short backstory: My UI code uses tabs heavly and as time progresses and features get added the .cs file that has the tab controls is getting big and hard to maintain and i came up with a what i think is a clever way around this. When i create tab page its new class that are inheriting the TabPage, and therefor in its own .cs file.

Now the problem: The new classes are working out great, but Visual Studio does not enter "Design mode" on the new class files it instead shows me editor without the ability to resize and change the UI elements. Does anyone know of a way to force VS.net to go into design mode? ( VS 2k8 )

Link to screenshot of VS.net incase i did not explain it so others explain

The new TabPages are created like this?

class AoCFolder : TabPage
+1  A: 

Right click on the file and select "Open With" - then choose the editor you want to use. You can also set the defaults in the same dialog.

Jon Skeet
For those using Visual Studio Express (yes, not the OP), the same can be accomplished by attributing the relevant class with [System.ComponentModel.DesignerCategory("Designer")]
Michiel Buddingh'
I may have explained it badly, but i uploaded another screenshot that explains it better. http://i25.tinypic.com/kdl505.png What i want is the editor where i can drag and drop UI elements, and when i use Open With and select "CSharp Form Editor" i get a editor where i can add, but not change their UI position or "design"
EKS
I suspect the designer basically doesn't "do" tab pages in that case.
Jon Skeet
@EKS Try the [System.ComponentModel.DesignerCategory("Form")] attribute, and see how that works. It all depends on whether the Form editor can make heads or tails of your class, I suppose, but maybe it can.
Michiel Buddingh'
@Michiel Buddingh' I did try that and the samet thing happens. It may be that this is not posible
EKS