View only one method?
In VB you had the option to view only one method (or sub, in VB) so that the rest of the code outside your current method wasn't seen. Is this possible in visual studio 2010 for C#?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Charles MorissettePosted Apr 20, 2011, 3:19 PM
If you chose the one with multiple small lines, it showed you your entire project - if your chose the one with two small lines, it showed you only your current sub/method. Was quite nifty, too bad it doesn't seem I can find it in Visual Studio.
Sam HobbsPosted Apr 20, 2011, 3:17 PM
Perhaps what you are looking for is "Ctrl-}". Put the cursor before or after a "{" or a "}" and then press "Ctrl-}" (or "Ctrl-]", which is the same thing). That will scroll to the matching symbol; try it and see. I use that to get the entire block to be shown, or scroll the window so the block fills the window more. Try it and I hope you see what I mean.
Charles MorissettePosted Apr 20, 2011, 1:00 PM
VulpesPosted Apr 20, 2011, 12:15 PM
In the case of C# I don't think there is even a way to separate methods by lines. However, VS is full of hidden options so if somebody else knows a way I'd be interested to know what it is.
You can, of course, do various forms of collapsing and outlining as you probably know already.