Hi,
I just wonder if someone came across this small problem: i add a class
file to the C# project and i implement a class derived from Form. Even
though i don't have a resx file assosiated with it VS still treats it as
a form file and on double click it tries to open a form instead of
opening code. I made change directly to the project file specifying that
this file is "code", but VS overrides it.
I havee bunch of those files (where i have form classes or user control
classesbut want VS to treat those as regular classes and not try to show
designer for them ) and it's kind of inconvenient to open those by right
click and choose "View code" rather that just double clicking.
Any ideas?
Thank you,
MuZZy
Robbe Morris [C# MVP] - 30 Jun 2006 02:22 GMT
Forms are classes. You are also inheriting the class Form.
How would visual studio which developers want
the form to render in the designer and which developers don't.
Just right click the class and click View Code. It
can't be that "inconvenient".

Signature
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp
> Hi,
>
[quoted text clipped - 14 lines]
> Thank you,
> MuZZy
tlkerns - 30 Jun 2006 04:33 GMT
Also, you can right-click on one of those files and click Open With ...
Select CSharp Editor and then click the Set as Default & OK buttons.
From then on you'll be able to double-click those files to open them in code
view.
Tony
> Forms are classes. You are also inheriting the class Form.
> How would visual studio which developers want
[quoted text clipped - 21 lines]
> > Thank you,
> > MuZZy
MuZZy - 30 Jun 2006 04:51 GMT
> Also, you can right-click on one of those files and click Open With ...
> Select CSharp Editor and then click the Set as Default & OK buttons.
> From then on you'll be able to double-click those files to open them in code
> view.
That's actually a very good idea! I open code times more often than
designer so it shoudl work well for me!
Thanks a lot!
> Tony
>
[quoted text clipped - 23 lines]
>>> Thank you,
>>> MuZZy
MuZZy - 30 Jun 2006 04:50 GMT
> Forms are classes. You are also inheriting the class Form.
> How would visual studio which developers want
> the form to render in the designer and which developers don't.
Well, for example if there is no associated *.resx file it's logically
to treat that class as just class - anyway VS will fail to load designer
if there is no *.resx for *.cs
> Just right click the class and click View Code. It
> can't be that "inconvenient".
Linda Liu [MSFT] - 30 Jun 2006 04:57 GMT
Hi MuZZy,
Thank you for posting.
Once you inherit a class from Form, the class is of type Form which has a
UI. When you double click a class with a UI in Solution Explorer, it is the
default behavior for VS to display it in the designer. As far as I know,
there is no way to change this default behavior.
If you want to display a class with a UI in a code view, you could select
this class in Solution Explorer and click the View Code button on the head
of the Solution Explorer, or press F7.
Hope this helps.
If you have anything unclear, please don't hesitate to let me know
Sincerely,
Linda Liu
Microsoft Online Community Support
====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================
C# Newbie - 30 Jun 2006 20:27 GMT
View-->Class View. In the Class View tab open any form, you won't get the
GUI...
my 2 cents...
> Hi,
>
[quoted text clipped - 14 lines]
> Thank you,
> MuZZy