Box Selection – Visual Studio C#

VISUAL STUDIO TIPS

Edit multiple lines of code at the same time

Tip 1: Box Selection

Let’s take an example of the following class with integer properties and apply box selection to update int to, let’s say, double at one shot.

public class Test {
int x = 10;
int y = 20;
int z = 30;
int l = 40;
}

Shortcut Key: “Shift + Alt + down arrow (to select multiple rows).”

Isn’t it great..!!

So the box selection works with all types of file extensions like “.cs” or “.html,” etc., in Visual Studio.

Example: “.html” file

Tip 2: Convert excel sheet data into class objects

Let’s take an example of the following excel data

Firstly, implement a class with columns.

public class Excel{
public string Name;
public string Age;
public string City;
}

Live Demonstration

Utilize box selection to convert excel data into class objects. I find it useful for developers.

Advantages

  • It saves a lot of time.
  • Better than copy-paste.
  • Hence it is more productive.
  • Works with all file extensions.

Thank you for reading, and I hope you liked the article. Please provide your feedback in the comment section.

Follow me on

C# Publication, LinkedIn, Instagram, Twitter, Dev.to, Pinterest, Substack, Wix.

Leave a comment