Designers and Partial Classes

We played a bit with the Whidbey designers today, and then switched to View Code.

And oops, surprise - the code one sees is now a partial class. You can't see the designer-generated code anymore.

That sounds baaaaaad to me. I want to see the code the designer creates.

Please tell me that there is a way to see the code that the designers generate  I am not sure I find the partial classes to be an improvement - while it is cleaner not to have the generated code folded away, if the price to pay is not to see this code ever again, I want the old way back!

Why not have tabs like in the HTML editor that show either code or the design  Or a 2nd View Code option that shows the designer-generated code

Please don't hide this stuff. It may be easier for beginners, but I am pretty sure most users who are beyond beginner level would want to see the code!

    PM


Answer this question

Designers and Partial Classes

  • Ceres

    also, you shouldn't mess with the designer generated code .. rather do that in the constructor or OnLoad
  • CB812

    There is... atop the solution explorer there is a button which (when hovered over) says "Show All Files".  Press that button.  Then Form1 will show up as a [+] in the solution.  Expand that node and you should see a file called Form1.Designer.cs.  This is where InitializeComponent is now.

     

  • Vachan

    The easiest way to do it is to right-click on the InitializeComponent method call in the contructor and click on Go To Definition...
  • Designers and Partial Classes