Alt + Click + Drag shortcut key


A couple of days ago I found a shortcut key that I don’t think is very well known that is a simple but useful shortcut key. It stops you from having to do multiple copy and pastes .

Say you have code like below,

public string Value1 { get; set; }
public string Value2 { get; set; }
public string Value3 { get; set; }
public string Value4 { get; set; }

Now if this were a static class and you had to change all the properties to static you could type once then copy and paste or type multiple times, or you could place you cursor after the public in the first line and the hold Alt + Click and drag down. Yuo should see a slight line (about a pixel or 2) like below.


Now all you do is press space and type static and it should look like below.

public static string Value1 { get; set; }
public static string Value2 { get; set; }
public static string Value3 { get; set; }
public static string Value4 { get; set; }

This is also very useful for renaming lots of similar variables (if there is the situation)

public static string ActualValue1 { get; set; }
public static string ActualValue2 { get; set; }
public static string ActualValue3 { get; set; }
public static string ActualValue4 { get; set; }

Like I said nothing special but saving time is saving time =D.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s