*stomps on .NETs auto format*

wyrd

Well-known member
Joined
Aug 23, 2002
Messages
1,408
Location
California
Okay.. heh.. Ive been programming like this for 5 years;

if (something) {
stuff..
}

Notice where the { } are? .NET auto formats it to..

if (something)
{
stuff..
}

Ive always hated that because it just.. I dont know.. I hate looking at lines with a single { on it. Just, argh n stuff. Is there ANY way to make the .NET IDE not format my darn { }? Heh.

While Im at it, I heard about a new .NET update coming out soon and part of it will boost the intellisense in C#. Does that include adding events available to the drop downs? One huge difference Ive noticed is that in VB.NET you can sift through all of the events available for the selected object (talking about the code window here, the two drop downs at the top) and itll write in the code for you when you select the event. Either Im missing something, or C# just doesnt allow that and you need to add delegates to the events yourself and point it to whatever function you want to handle the event. On an oddball note, however, it does auto code the Click events for you. :confused: Not really an annoyance thing (Im used to coding out events in Java), but more or less just curious. :)
 
You can change the auto-formatting in the IDE options.

Text Editor -> C# -> Formatting -> Leave open braces on same
line as construct.

To add events click the control, and in the property window, click
the lightning bolt to change the properties to a list of events. Then
type the name of the delegate sub into one of the Events and press
enter. That wires the event up for yoo.
 
Originally posted by VolteFace
You can change the auto-formatting in the IDE options.

Text Editor -> C# -> Formatting -> Leave open braces on same
line as construct.

Aha! Now were talkn. :cool:


To add events click the control, and in the property window, click
the lightning bolt to change the properties to a list of events. Then
type the name of the delegate sub into one of the Events and press
enter. That wires the event up for yoo.

.... I knew that. :rolleyes:

Anything else them people at MS decided to alter when using C# compared to VB? Concerning the IDE that is, not the language itself heh.

BTW, thanks. :)
 
Wyrd, I do the same thing, although I didnt change it in the options, I still fixed each line after the autoformat was done and they stayed in place.
 
That lack of being able to create event definitions easily in C# is kinda annoying. I know you use the property browser to do it for controls, but what about other objects you have declared in code?

Yes, the next release of Visual Studio addresses this. As far as I know it doesnt have those combo box things to do it, but if you start typing a line like this:

C#:
myobject.myevent +=

It will pop up an intellisense thing saying "press tab to finish line and create procedure" and it will write the necessary code and take you to the procedure it creates.
 
Back
Top