OT: Adding a Class to Visual Studio

C

Chris Dunaway

I run Visual Studio 2005 Professional and when I right click on a
project and choose Add > Class..., it opens the "Add New Item" dialog
where I can pick the item and continue.

I would like it so that if I choose Add > Class, that it actually
adds a class!! If I choose Add > New Item, then the dialog box is
understandable. But if I choose Add > Class, it should ADD A CLASS!

The same thing happens when I choose Add > Windows Form!! It seems
like it should just add a form *without* bringing up the Add New Item
dialog.

Does anyone know a way to make it function as I desire or extend the
Add menu with additional choices?

What I want:

When I click Add > Class, I want a new class to be added without
popping the dialog.
When I click Add > Windows Form, I want a new Windows Form without
popping the dialog.

After all, what is the point of having those two specific menu items
when they function exactly the same as Add> New Item?

Chris
 
S

sloan

What are you going to name the new Class or Form?

Do you really want

public Class1

and after that

public Class2

and then

public ClassN

and then

Class1.cs
Class2.cs
ClassN.cs

so then you have to go rename the class (in the code) and rename the
filename?



...

I"ll take the pop up dialog anyday over that.


When the pop up comes up.... you just type in

Employee

and then you'll get

class Employee in the file Employee.cs (or .vb)


As I said, that's better than renaming stuff after the fact.
 
C

Chris Dunaway

What are you going to name the new Class or Form?

Do you really want

public Class1

and after that

public Class2

and then

public ClassN

and then

Class1.cs
Class2.cs
ClassN.cs

so then you have to go rename the class (in the code) and rename the
filename?

..

I"ll take the pop up dialog anyday over that.

When the pop up comes up.... you just type in

Employee

and then you'll get

class Employee in the file Employee.cs (or .vb)

As I said, that's better than renaming stuff after the fact.

Then why have the extra menu items? All you need it Add > New Item.
Why have Add > Class and Add > Windows Form then? They behave
*identically* to Add > New Item.

I agree with you about have a class1 and class2, etc.

What I would expect would happen is to choose Add > Windows Form and
have it prompt me for the name. Then I could type the name and then
press enter. Now, I choose Add > Windows Form. It pops the Add New
Item dialog. I then have to *click* the Windows Form item, change the
name and press enter. In other words, when I select Add > Windows
Form, it *does not* automatically select the Windows Form item in the
dialog!

All of the various Add > ... menu choices bring up the *same* new item
dialog!! They are redundant!

Thanks for the reply,

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top