How to force VS2005 to NOT load a .CS file in design view.  
Author Message
Marci Weinberger





PostPosted: Visual C# IDE, How to force VS2005 to NOT load a .CS file in design view. Top

Hi All,

I have a standard run of the mill CS file, which contains a couple of classes. Actually the project has several CS files and all of them open perfectly normal except this one, which VS05 wants to open in design view. The offending item is that this particular class is based on the system timer.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace MyNameSpace
{
    public class MyOrdinaryClass :
System.Windows.Forms.Timer
    {
    }
}


As you can see this class is super ordinary with the exception that I based it on the system timer, which is fine. I just want VS05 to open this file in ordinary mode, not in design mode, which gets triggered by the derived class.

Is there any way to tell VS05 to ignore that for opening purposes Thanks in advance,

Marci Weinberger


Visual C#4  
 
 
Mark Benningfield





PostPosted: Visual C# IDE, How to force VS2005 to NOT load a .CS file in design view. Top

Hello All.

Marci:

Right-click the file in SolutionExplorer, select "Open With...", and choose CSharp Editor. Then click the SetAsDefault button to make this file open with the editor by default.

HTH.



 
 
Marci Weinberger





PostPosted: Visual C# IDE, How to force VS2005 to NOT load a .CS file in design view. Top

Wow! I learnt something new. :-) I never even saw that option there. Thanks! :-)

Marci