Vadim's Weblog

Never stop learning.

Archive for the ‘Tips And Tricks’ Category

Invisible Task Manager menu bar and tabs.

Posted by Vadim on January 20, 2010

image Today I was pair programming with one of my co-workers, and during the session he somehow made Task Manager tile,  menu bar, tabs, and status bar disappear.  At first, we had no clue how it happened and were forced to use Alt+F4 to close Windows Task Manager because close (x) button was gone with the title bar.  However, in a little while he did it again.  He was double clicking on the empty space in the top border.

You can try it yourself.  Just start Windows Task Manager and double click anywhere in the empty space in the top border.  Double click again to get the menu and tabs back.   If you are not sure where the top border is, just double click in the same place the cursor is located on the image that you see on the right.

If you know of other weird behaviors in Windows, please let me know.

Posted in Tips And Tricks | Tagged: , | 3 Comments »

Copy & Paste is broken in Visual Studio 2010 CTP

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

2010_Option_Copy_Paste

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.

kick it on DotNetKicks.com

Posted in Tips And Tricks, Visual Studio, VS2010 CTP | Tagged: , | Leave a Comment »

Incremental search in Visual Studio

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:” labelIncrementalSearch 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.

kick it on DotNetKicks.com

Posted in Tips And Tricks, Visual Studio, VS2005, VS2008 | Tagged: , , | Leave a Comment »

Shortcut Key to Comment code in VS and SQL Server Management Studio

Posted by Vadim on October 16, 2008

When we learn any programming language, one of the firsCtrl+Ct 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.

kick it on DotNetKicks.com

Posted in .Net, Coding, ReSharper, Tips And Tricks, Visual Studio | Tagged: , , , | 5 Comments »

Jump between braces in Visual Studio.

Posted by Vadim on July 9, 2008

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

kick it on DotNetKicks.com

Posted in Tips And Tricks, Visual Studio | 22 Comments »

A faster way to lock your computer.

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.

kick it on DotNetKicks.com

Posted in Tips And Tricks | 4 Comments »

Vista Start menu power button should Shut down.

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

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

EditPlanSettings_PowerOptions

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.

PowerOptions

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.

redPowerButton

kick it on DotNetKicks.com

Posted in Tips And Tricks, Vista | 4 Comments »

Copy text from a MessageBox

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

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.

kick it on DotNetKicks.com

Posted in Tips And Tricks | 11 Comments »

Copy and Paste in Visual Studio and MS SQL Server Management Studio.

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 :) ).

kick it on DotNetKicks.com

Posted in Tips And Tricks, VS2005 | Tagged: , | 9 Comments »