-
[RESOLVED] Auto-Spacing
I don't know how to name it, so I named it autospacing
When I type this code in VB:
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
System.Console.WriteLine("example")
End Sub
End Class
When I press enter, the code will automatticly go like this:
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
System.Console.WriteLine("example")
End Sub
End Class
but when I type a code in C# like this:
Code:
using System
namespace examplecode
{
class exampleclass
{
static void Main()
{
Console.WriteLine("example");
}
}
}
it won't go right automaticly, is there a way to activate this?
Thanks in advance! 8D
-
Re: Auto-Spacing
Code formatting works differently in the VB and C# IDEs. If you have unformatted code in C#, try deleting and then retyping the last closing brace, i.e. '}'. Tada! That works for code blocks and for single lines the thing happens when you type the semi-colon at the end, i.e. ';'.
Just note that C# requires that your syntax be valid in order to auto-format, which yours isn't. You'd need to add the semi-colon to the end of the 'using' statement first.
-
Re: Auto-Spacing
Well, I typed this code out of my head, but I copied the code from a e-book I was learning, there using WAS with a ;, but in the middle of the code a page number showed up. I had to delete the number, cut-paste everything and C# did the trick! ^^
thanks :D