*stomps on .NETs auto format*

wyrd

Senior Contributor
Joined
Aug 23, 2002
Messages
1,405
Location
California
Okay.. heh.. I've been programming like this for 5 years;

if (something) {
stuff..
}

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

if (something)
{
stuff..
}

I've always hated that because it just.. I don't 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 I'm 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 I've 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 it'll write in the code for you when you select the event. Either I'm missing something, or C# just doesn't 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 (I'm 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.
 
VolteFace said:
You can change the auto-formatting in the IDE options.

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

Aha! Now we're talk'n. :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 didn't 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 doesn't 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