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

  1. It saves a lot of time.

  2. Better than copy-paste.

  3. Hence it is more productive.

  4. 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.

#TipsAndTricks #Tips #VisualStudioCode #VisualStudio #Programming

Recent Posts

See All

Design Pattern – Adapter

#Aspnetcore #AdapterDesignPattern #Csharp #DesignPatterns #Dotnet According to Gang of Four, the Adapter Pattern converts the interfaces of a class into interfaces that the client requires. In other w