Sign in to follow this  
graveyard filla

How to collapse code blocks in VB.NET or C# (VS.NET 2k3)

Recommended Posts

Hi, Quick question.. is there anyway to collapse loops, if statements, etc in VB.NET? What about C#? I'd be very surprised if this was possible in C++ but not in these 2 languages, but it seems thats how it is by default... anyone know how to turn this on? Thanks.

Share this post


Link to post
Share on other sites
The The VS beta supports code collapsing, and with Visual Assist [by Whole Tomato Software, I believe...finding a link shouldn't be too hard] you can get it in previous versions.

Several alternative IDEs support it as well. I think Eclipse does, for instance.

CM

Share this post


Link to post
Share on other sites
If nothing else, you can use manually specified regions to do the same thing.
//C#:
#region Name/Description of Region
#endregion

//C++:
#pragma region Name/Description of Region
#pragma endregion

Don't know what VB's syntax is, but I'm sure it exists.

But maybe you already know such things exist, since you were asking specifically about code blocks, and were probably looking for automatic collapsing ability. I unfortunately can't help you with that.

[edit]I should note that I do not know if this works with 2003; I've skipped from 6.0 to 2005 beta, so that's all I know about.[/edit]

Share this post


Link to post
Share on other sites
I know that in VS.NET 2003, code collapsing works with C++, just not with VB.NET or C#... this gets very annoying since I'm so spoiled by the collapsing in C++... VB.NET is ugly enough as it is, why the hell can't I collpase the code? [grin]. Anyway, just trying to clear up, are you confirming that it doesn't work w/ VB.NET in 2k3? Or ...

Quote:
Original post by Conner McCloud
The The VS beta supports code collapsing, and with Visual Assist [by Whole Tomato Software, I believe...finding a link shouldn't be too hard] you can get it in previous versions.

Several alternative IDEs support it as well. I think Eclipse does, for instance.

CM


Share this post


Link to post
Share on other sites
Quote:
Original post by Agony
If nothing else, you can use manually specified regions to do the same thing.
//C#:
#region Name/Description of Region
#endregion

//C++:
#pragma region Name/Description of Region
#pragma endregion

Don't know what VB's syntax is, but I'm sure it exists.

But maybe you already know such things exist, since you were asking specifically about code blocks, and were probably looking for automatic collapsing ability. I unfortunately can't help you with that.

[edit]I should note that I do not know if this works with 2003; I've skipped from 6.0 to 2005 beta, so that's all I know about.[/edit]


Thanks for the reply... yeah, I know thats possible, but I'd much rather be able to automatically collpase loops and if statements, it comes in handy and can actually prevent bugs...

I'm finding it VERY hard to believe that I can collapse ifs and loops in C++ but not in the other, high level languages!!! Google is not helping me and I know this must be possible...

Thanks for any more help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this