473,322 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Getting VS.NET to add method brackets automatically?

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.
Nov 16 '05 #1
9 2503
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 Falk" <cf**@critterdesign.net> skrev i meddelandet
news:i1********************************@4ax.com...
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.

Nov 16 '05 #2
Cristof Falk wrote:
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.
Nov 16 '05 #3
Thanks to you both.

Nov 16 '05 #4
Cristof Falk wrote:
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.
Nov 16 '05 #5
Oh...that's a good idea!

On Sat, 10 Apr 2004 13:18:35 +0100, C# Learner <cs****@learner.here>
wrote:


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.


Nov 16 '05 #6
Cristof Falk wrote:
Oh...that's a good idea!


This looks promising -
http://weblogs.asp.net/rosherove/arc...2/10/2123.aspx

Google search to find that was -
http://www.google.com/search?q=%22vs...+insert+braces
Nov 16 '05 #7
"Andreas Håkansson" <andy.h (at) telia.com> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl...
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).
Nov 16 '05 #8
Michael,

Nothing but a typo =)

//Andreas

"Michael Mayer [C# MVP]" <mi**@mag37.com> skrev i meddelandet
news:u%****************@tk2msftngp13.phx.gbl...
"Andreas Håkansson" <andy.h (at) telia.com> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl...
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).

Nov 16 '05 #9
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.
--------------------
Date: Sat, 10 Apr 2004 13:30:31 +0100
From: C# Learner <cs****@learner.here>
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: Re: Getting VS.NET to add method brackets automatically?
References: <i1********************************@4ax.com> <#U**************@TK2MSFTNGP12.phx.gbl> <r4of70hip4h8in56n4r3ub32215m5bngj4@ 4ax.com> <#e**************@tk2msftngp13.phx.gbl> <2s********************************@4ax.com>In-Reply-To: <2s********************************@4ax.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <eo**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: user-2594.l2.c2.dsl.pol.co.uk 81.77.106.34
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:236599
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Cristof Falk wrote:
Oh...that's a good idea!


This looks promising -
http://weblogs.asp.net/rosherove/arc...2/10/2123.aspx

Google search to find that was -
http://www.google.com/search?q=%22vs...+insert+braces

Nov 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gregor Horvath | last post by:
Hello, class A(self): def A1(): pass class B(self): def B1(): #************************************ #*** How can I access A1 here???? ***
4
by: Kevin | last post by:
I have a document, lets say: <Doc> <Ele1 Att1='hello'> <Ele2 Att2='goodbye'/> </Ele1> </Doc> In XSLT I need to generate an attribute value which contains part of this document as a text...
37
by: ajay | last post by:
How to make a web page getting refreshed after a given time interval automatically. HTML Code plz. Tx Ajay
18
by: lawrence | last post by:
If I'm pretty sure there is just one form on the page, can i do this? var myForm = document.forms; If I'm not sure about the form, is it safer to do this? if (document.forms) { var myForm =...
9
by: Cristof Falk | last post by:
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,...
4
by: R.Manikandan | last post by:
Hi In my code, one string variable is subjected to contain more amount of characters. If it cross certain limit, the string content in the varabile is automatically getting truncated and i am...
3
by: Andrew Gentile | last post by:
Hello, I am trying to write a function which takes several floats as inputs, then returns 1x6 array of floats. I normally program in Matlab, and I am often confused by C. It seems that this...
7
by: Andrus | last post by:
How to get syntactically correct signature which compiles for code template grneration ? I tried code below but it creates syntactically incorrect signature. Andrus. using System; using...
9
by: netimen | last post by:
I have a text containing brackets (or what is the correct term for '>'?). I'd like to match text in the uppermost level of brackets. So, I have sth like: 'aaaa 123 < 1 aaa < t bbb < a <tt ff 2...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.