54

How can I make Visual Studio default to View Source when you double-click the Form1.cs. I prefer to make View Source the default of double-click than View Designer.

Himanshu
  • 31,810
  • 31
  • 111
  • 133
Hao
  • 8,047
  • 18
  • 63
  • 92

3 Answers3

71

Right click the file in the Solution Explorer, choose "Open With...", select the CSharp Editor, and click the "Set as Default" button.

Paul Stovell
  • 32,377
  • 16
  • 80
  • 108
12

Right click a form file and click "Open With...". Pick your desired designer to open as default (in this case "CSharp Editor" or "Microsoft Visual Basic Editor") and click "Set as Default". Voila.

Chris Hynes
  • 9,999
  • 2
  • 44
  • 54
1

with this attribute myClass will open in the code editor and not the designer:

[System.ComponentModel.DesignerCategory("")]
public class myClass : Form
{

}
Frank
  • 39
  • 4