Click here to Skip to main content
15,890,185 members
Articles / IDE
Alternative
Tip/Trick

VS2010 Box Selection with Copy and Paste

Rate me:
Please Sign up or sign in to vote.
4.29/5 (6 votes)
17 May 2010CPOL 7.3K   1   1
A Cooler one for me is the multi-lines simultaneous typingwith which you can accomplish the above task in the following fewer steps1- In the method where you wish to build the list, paste the list of names2- Because compiler will not understand these lines, it will not be correctly...
A Cooler one for me is the multi-lines simultaneous typing
with which you can accomplish the above task in the following fewer steps

1- In the method where you wish to build the list, paste the list of names
2- Because compiler will not understand these lines, it will not be correctly indented, so indent them manually
3- Create a vertical zero-char width box selection before the names
4- Start typing sb.Appen..... (it will be written 20 times :) )
StringBuilder sb = new StringBuilder():
sb.AppendLine("Peter
sb.AppendLine("Paul
sb.AppendLine("Mary
sb.AppendLine("Susan
sb.AppendLine("Joe

5- Repeat step 3 at the end of the names to close the methods and add semicolons

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Microsoft
Egypt Egypt
15+ years of experience in software industry
Writing .NET, Angular, Xamarin, SQL

Comments and Discussions

 
GeneralThanks for this alternate, Muhammad, but I don't think I'm g... Pin
TheyCallMeMrJames18-May-10 2:49
TheyCallMeMrJames18-May-10 2:49 
Thanks for this alternate, Muhammad, but I don't think I'm going to accept it as an alternate.

Here's a couple reasons why:
1) The tip as you suggested is great...and Microsoft has rightly used it exactly as you suggest in most of their marketing. While it's something that should be in every coder's toolbox, it's something folks should know. (It's also something I've blogged about for almost a year!)
2) It's different enough of a use that it could warrant it's own tip.
3) It's not a true alternative: you cannot start repeating at step 3 without injecting whitespace into the names (they would be padded to the quotes with a second zero-width box selection).

Thanks for your input...I'm always open to suggestions, feedback and especially conversation!

Cheers,
-James

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.