Getting VS.NET to add method brackets automatically?

  • Thread starter Thread starter Cristof Falk
  • Start date Start date
C

Cristof Falk

I'm using VS.NET 2002 w/C# on one project. I'd like it to, when
defining a new method, to automatically put the {} brackets
automatically. I prefer having brackets closed before coding. Right
now, one has to type the open bracket, then hit enter, then delete a
tab, then type the close bracket, then go to the open bracket and hit
enter. I thought I read that the IDE would do this automatically.

Does later versions do this in the way I hoped? Thanks.
 
Cristof.

We will see some of these autocompeletion in VS.NET2004 but
they are not in 2003. There are plenty of free and commercial add-ins
for VS.NET which will help you with stuff like this.

HTH,

//Andreas
 
Cristof said:
I'm using VS.NET 2002 w/C# on one project. I'd like it to, when
defining a new method, to automatically put the {} brackets
automatically. I prefer having brackets closed before coding. Right
now, one has to type the open bracket, then hit enter, then delete a
tab, then type the close bracket, then go to the open bracket and hit
enter. I thought I read that the IDE would do this automatically.

Does later versions do this in the way I hoped? Thanks.

Just to add...

In 2003, when you type a closing bracket, an auto-de-indent happens, so
you don't have to press backspace there.
 
Cristof said:
Thanks to you both.

It just occured to me -- couldn't you just write/find a macro that does
this, and then assign it to a keyboard command?

I'd imagine that this is possible, though I've never dabbled with macros
in VS.NET, myself.
 
Andreas Håkansson said:
Cristof.

We will see some of these autocompeletion in VS.NET2004 but
they are not in 2003. There are plenty of free and commercial add-ins
for VS.NET which will help you with stuff like this.

Actually, it is Visual Studio 2005 (there will be no vs 2004).
 
The next version of VS (the one that people now already know as VS 2005) has similar feature implemented by way of code templates that can do stuff people might
want a keystroke to do. Using this infrastructure this type of things, like adding an automatic closing brace or a pair of braces should be very easy.

Thanks
Sumas[MS}

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

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

Back
Top