Vakul's .NET Realm

My journey towards .NET World…

  • Details

    Vakuls MCPD Certification Vakuls MCTS Certification Author's Pic



  • Blog Stats

    • 142,380 hits
  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 355 other followers

  • Follow me in Twitter:

    Error: Twitter did not respond. Please wait a few minutes and refresh this page.




  • qrcode
  • Subscribe

  • del.icio.us:

Visual Studio Tips & Tricks

Posted by Vakul Kumar More on January 12, 2012


Developers spend most part of the day with Visual Studio and using shortcuts and hidden features would definitely improve the productivity.

I’m presenting few tips and Tricks along with hidden features and customizations for the developers. Please add any new features in the comments section.

  • Full Screen Mode

Developers sometimes get distracted with the alerts and there is a solution for that. Alt-Shift-Enter toggles from regular view to full screen mode, so you can see a lot more code.  Windows Task bar is also hidden and definitely productive.

  • Copy/Cut a line of Code

We don’t have to select a complete line to copy or delete it, use CTRL-C/CTRL-X anywhere in the line.

  • Saving And Restoring Visual Studio Settings

Tools –> Import and Export Settings can be used to export the settings to an other machine.

Visual Studio default settings can be restored by selecting “Reset all Settings”

  • Select a rectangular area of text.

Hold Alt down and drag mouse over text area you like to select.

VSRectangular

  •  Conditional Breakpoints

If you’re debugging through a loop, waiting for something specific to happen—like a variable to have a specific value—use the Conditional Breakpoint capability. When you set a breakpoint, right-click on its red blob and choose “Condition…” in the popup menu.

VSConditionalBreakpoint

  • Use line numbering on your source code editor.

Using line numbers largely improves productivity, especially when four eyes are looking at a code and discussing it. Turn on line numbering by going to the menu Tools | Options. Look for Text Editor | All Languages | General and check the
“Line numbers” checkbox.

VSLineNumbers

  • View different parts of the same document.

Sometimes, it’s good to view different parts of the same document for reference purposes. At the very top of the scrollbar, there’s a little rectangle. Click and drag that down for two windows into the same code file. When done, simply drag back the splitter to collapse the window.

VSDifferentParts

  • See List of 10 Recent Projects in window menu, Not Just 4

On the Tools->Options->Environment, you can have Visual Studio show the 10(Maximum is 24) most recent projects you’ve opened, rather than just the most recent 4. (This also works in Microsoft Office and many other applications.)

VSRecentProjects

  • Find in Visual Studio IDE

Ctrl+F is known to all developers to find a word or string in current document, all open documents or entire project or entire solution. One other hidden option is Ctrl+Shift+F, this is helpful by listing results in a find window unlike navigating one by one in every file where the searched word/string exists.

  • Incremental Search

To incrementally search for text as being typed, first press Ctrl+i. Then type the word to be searched. Hit backspace to clear a character and enter to finish. Pressing F3 after this will work as usual, i.e. search for the next occurrence of previous search.

Ctrl+iCtrl+i works like F3.

  • Important Shortcuts in Visual Studio IDE

Ctrl+Alt+L  – Opens Solution Explorer

Ctrl+Alt+X  -   Shows Toolbox

F4 – Opens properties window

Ctrl+\+E – displays error list

Ctrl+\+T – displays tasklist

Ctrl + M + M  – Expanding and collapsing code blocks

  • Surround with code Snippet  (C#)

Snippet can be placed around a code block using shortcut CTRL+K+S.

VSSurroundCodeSnippet1

VSSurroundCodeSnippet2

  • Image library by Microsoft to use in Visual Studio applications

During the Visual Studio setup, the VS2008ImageLibrary.zip file is installed at \Program Files\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary\

I will keep updating this post, please let me know if you know of any tip.

HAPPY PRODUCTIVE CODING Smile

Advertisements

12 Responses to “Visual Studio Tips & Tricks”

  1. rammysagar said

    Hi Vakul , Thanks for the tips .

  2. praveen said

    Very good and most usefull ..i liked ctrl+i key…….

  3. ramakrishna said

    Excellent Vakul, really very helpful.
    Thanks,
    ramakrishna

  4. Markand said

    I enjoyed reading it.
    Cool stuff.
    keep it up

  5. Suvendu said

    Nice share.Sara ford’s book has them all in case anybody wants to learn more..

  6. ravni said

    Thanks Vakul .. I like contrl+M+M tip

  7. MM said

    Thanks Vakul. I liked the breakpoing with condition the best.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
%d bloggers like this: