[ACCEPTED]-Visual Studio: Make view code default-visual-studio

Accepted answer
Score: 268

Right-click on a file and select "Open With..."

Select 1 "CSharp Editor" and then click "Set as Default".

Score: 13

Decorate your class with [System.ComponentModel.DesignerCategory("")], e.g.:

public class MySpecialButton : System.Windows.Forms.Button


Score: 5

I like having my forms open up in Design 9 View, but I made a partial class file which 8 had only code and Visual Studio wanted to 7 open it in Design View all the time. To 6 prevent Visual Studio from realizing that 5 a specific source file can be loaded by 4 Designer, look at the csproj file for the 3 Compile Include tag of the appropriate source 2 file and remove the SubType tag underneath 1 it.

Score: 5

I came across this issue myself recently 3 and the above solutions did not solve my 2 issue. I needed to go into Tools | Options and change the 1 settings for HTML Designer to Enable HTML designer and select Start pages in: Source View.

Settings screenshot

More Related questions