Posted by Vadim on November 9, 2008
I was astonished when I realized that copying & pasting a line in VS 2010 doesn’t works the same as in previous versions of Visual Studio. I was
blogging more than a year ago about wonderful feature how to copy and paste in Visual Studio.
In previous versions you can copy a line by moving cursor anywhere on a line you want to copy and without selecting anything press Ctrl-C. Then you can paste that line anywhere by pressing Ctrl-V. The line will be inserted above the line where the cursor is without breaking that line.
However, in VS 2010 CTP the same technique will not work despite that option to turn this feature on/off exists in Options dialog. Just open this dialog by selecting Tools/Options and then select Text Editor/All Languages. ‘Apply Cut or Copy commands to blank lines when there is no selection’ check box should be checked by default.

Actually in previous VS version I notice the same broken behavior with XAML files.
I really hope that Microsoft will make copy & paste work as before. I’m so used to move line up or down with Ctrl-C and Ctrl-V keys.

Posted in Tips And Tricks, VS2010 CTP, Visual Studio | Tagged: Tips And Tricks, VS2010 CTP | Leave a Comment »
Posted by Vadim on October 18, 2008
When you’re writing code in VS environment, I bet that you often use Ctrl+F keystroke to display “Find and Replace” dialog box.
There’s a better way. Next time you need to look for some text in your code, press Ctrl+I and start typing your search. After the text is found, you can use F3 key to find a next occurrence.
As soon as you press Ctrl+I, you’ll see “Incremental Search:” label
on the left part of VS status bar. Your search text will appear on the status bar as you type it. If you mistype your search text, you can use Backspace key to correct wrong characters.

Posted in Tips And Tricks, VS2005, VS2008, Visual Studio | Tagged: Incremental Search, Tips And Tricks, Visual Studio | Leave a Comment »
Posted by Vadim on October 16, 2008
When we learn any programming language, one of the firs
t thing we discover is the syntax how to comment our code. Some of you probably already have been using this shortcut key for awhile.
Select multiple lines of code and press Ctrl+K,Ctrl+C, and you hard work is going to be ignored. To reverse just press Ctrl+K,Ctrl+U.
These keystrokes will comment/uncomment your code only with line comment like // in C# or — in SQL. I’m not aware how to comment code with block comment (/**/) without using a plug-in for VS.
One more thing. If you need to comment/uncomment a single line, you don’t need to select the whole line. Just move the cursor to any position on the line you want to comment, and let you fingers press the magic combination.
If you like me (there’s nothing wrong to be different from me) and use ReSharper, than you would like to use Ctrl+Alt+/ with line comment and Ctrl+Shift+/ with block comment.

Posted in .Net, Coding, ReSharper, Tips And Tricks, Visual Studio | Tagged: C#, ReSharper, Tips, Visual Studio | 2 Comments »
Posted by Vadim on July 9, 2008
Have you ever scroll, scroll, scroll to find the beginning of if else statement? In this post I’m not going to tell you that long methods and classes are evil. Instead, I want to share with you how to move fast between open and close braces.
Put your cursor before or after the brace (your choice) and then press Ctrl+]. It works with either curly or round braces. From now on you don’t need to play Where’s Waldo? to find that brace.
I’ve been using this trick since Visual C++ 4.0.

Posted in Tips And Tricks, Visual Studio | 12 Comments »
Posted by Vadim on July 1, 2008
I’m probably the last one to learn this key combination to lock computer. Before this week, I was locking my computer by pressing three-finger salute (Ctrl-Alt-Delete) to launch Windows Security dialog and then press Enter key in order to lock my computer. Starting this week I’ll be pressing only Windows Key + L.
I figure by pressing Win+L I’m going to save half a second per each instance. Let assume that I lock my computer 6 times a day. It means I’ll save 3 seconds a day and this adds up to about 18 hours minutes a year.

Posted in Tips And Tricks | 3 Comments »
Posted by Vadim on July 1, 2008
First time I tried to Shut down my brand new Vista, I pressed the Windows key on my keyboard and then clicked on the power button.
However, it just put my PC in sleep mode. After that I’ve never used this button again until today. By exploring Advanced settings in Power Options, I realized that I can configure this power button.
The easiest way is to press your windows key on your keyboard
and start typing power. You should see Power Options in your Programs list.
Click on Power Options and Select a power plan window should be displayed on your screen.
This is a window where you can select your power plan. Under each plan you can see Change plan settings link. You should click on this link in order to navigate to Edit Plan Settings window.

We are not there yet. Click on Change advanced power settings link, and you’ll see Power Options window.
Almost there. In the list section of that window extend Power buttons and lid and then extend Start menu power button. In Setting change from default Sleep option to Shut down one.

Press the OK button and you are finally done. Now the power button is going to shut down Vista.
Also notice that before the power button was brown and now it’s reddish.


Posted in Tips And Tricks, Vista | 2 Comments »
Posted by Vadim on October 2, 2007
I learned how to copy text from a MessageBox about five years ago from one of my co-workers. For those of you who haven’t learned this trick yet; here it is.
Let assume that we have a Message Box like one on the right. To copy the message all you need to do is to press Ctrl-C when the Message Box has focus.
Next open your favorite text editor like Notepad and paste it there by pressing Ctrl-V. You’ll see text similar if not identical to this one:
—————————
Caption
—————————
Some Message!!!
—————————
OK
—————————
How cool is that.

Posted in Tips And Tricks | 8 Comments »
Posted by Vadim on March 21, 2007
I realized that many people don’t know how easy Visual Studio or SQL Server Management Studio allows us to copy, cut & paste. I’m sure that many of you know that but if you don’t, please give it try I’m sure that you’ll save some time.
Even my mother knows Ctrl-C, Ctrl-X, & Ctrl-V shortcuts to copy, cut, & paste. But do you know that you don’t need to select a line to copy/cut it. Just move cursor to the line you want to copy/cut and press Ctrl-C or Ctrl-X, the whole line will be copied into the clipboard.
We copied a line, now we can paste it. The line always will be posted above the line where you cursor is. And you cursor can be in any position on that line; I repeat ANY position of the line.
Do you know that you can cycle through the clipboard ring? Here’s the example where we are going to swap ‘var1’ and ‘var2’ words:
public void foo()
{
string s1 = "var1";
string s2 = "var2"
}
- First double click on word ‘var1’, to select it and then press Ctrl-C, to put the selection into the clipboard.
- Next double click on word ‘var2 and press Ctrl-C again. Now we have both selections in the clipboard.
- Now double click on word ‘var1’ again and replace it with ‘var2’ by pressing Ctrl-V. So far nothing new.
- Last, double click on word ‘var2’ on the next line where we’re declaring variable s2 and press Ctrl-Shift-V twice (it means two times :) ).

Posted in Tips And Tricks, VS2005 | Tagged: Tips And Tricks, Visual Studio | 7 Comments »