473,799 Members | 3,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2533
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**@critterde sign.net> skrev i meddelandet
news:i1******** *************** *********@4ax.c om...
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******** ******@TK2MSFTN GP12.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%******** ********@tk2msf tngp13.phx.gbl. ..
"Andreas Håkansson" <andy.h (at) telia.com> wrote in message
news:uQ******** ******@TK2MSFTN GP12.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> <r4of70hip4h8in 56n4r3ub32215m5 bngj4@ 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.publi c.dotnet.langua ges.csharp
NNTP-Posting-Host: user-2594.l2.c2.dsl. pol.co.uk 81.77.106.34
Lines: 1
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:2365 99
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
1669
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
3155
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 string, ie:
37
12754
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
8009
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 = document.forms; // more code here........ }
9
329
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, 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...
4
4510
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 not getting the full data. Is there any max limit for an variable to store in javascript? Can anyone please help me to solve this prob?
3
15648
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 should be an easy task, but I can't seem to get it done. Can someone please include a brief snippet of code which demonstrates how to get a function to accept 2 floats as inputs, and returns an array of 6 floats. Thanks.
7
4701
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 System.Collections.Generic; public class MainClass
9
2795
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 > bbbbb'. How to match text between the uppermost brackets ( 1 aaa < t bbb < a <tt ff 2 )? P.S. sorry for my english.
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.