473,394 Members | 1,640 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,394 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 2505
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.