Useful Visual Studio Shortcuts

  1. propfull = Creates full property.
    1. private int myVar;  
    2.   
    3. public int MyProperty  
    4. {  
    5.    get { return myVar; }  
    6.    set { myVar = value; }  
    7. }  
  2. Prop = Creates half property.
    1. public int MyProperty { getset; }  
  3. Propdp = Creates dependency property.
    1. public int MyProperty  
    2. {  
    3.    get { return (int)GetValue(MyPropertyProperty); }  
    4.    set { SetValue(MyPropertyProperty, value); }  
    5. }  
    6.   
    7. // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc...  
    8. public static readonly DependencyProperty MyPropertyProperty =  
    9. DependencyProperty.Register("MyProperty"typeof(int),typeof(ownerclass), new PropertyMetadata(0));  
  4. Ctrl + .(Dot) – Resolves namespaces, generates method stub, renames every reference.

  5. Shift + F12 = Gives all references of item.

  6. Ctrl + K, C = Comments code

  7. Ctrl +K, U = Uncomments code.

  8. Ctrl +K, K = Creates bookmark.

  9. Ctrl +K, P = Navigate to previous bookmark.

  10. Ctrl +K, N = Navigate to next bookmark.

  11. Ctrl +K, L = Remove all bookmarks.

  12. Ctrl +K, S = Surround code with try catch etc.

  13. Shift + F9 = Quick watch.

  14. F9 = Insert or remove breakpoint.

  15. Ctrl + shift + F9 = Delete all breakpoints.

  16. F7- Go to code behind.

  17. Shift + F7 = Go to designer.

  18. F5 = Start debugging.

  19. Shift + F5 = stop debugging.
Next Recommended Reading Shortcuts For Debugging In Visual Studio