asolovyov
asolovyov

Reputation: 963

How to surround code blocks with try/catch in VisualStudio 2010

I know that Visual Studio has some tools for fast surrounding by code snippets, for example how to do more faster try/catch code blocks. but I can't find a hotkey combination to do this. Who knows the hotkey combination for try/catch?

Upvotes: 51

Views: 33063

Answers (4)

user16369468
user16369468

Reputation:

For Mac users, select the code that you want to surround -> press cmd+shift+P, type: surround with, Select a snippet: try-catch

Upvotes: 1

pmh
pmh

Reputation: 312

Press Ctrl + K, followed by CTRL + S Type T Press Enter or Tab

Upvotes: 3

Daniel Hilgarth
Daniel Hilgarth

Reputation: 174299

Try Ctrl + K, Ctrl + S.
Source

Upvotes: 33

Sasha
Sasha

Reputation: 1736

Press "Ctrl + K, S" and then in drop down menu double click "try" - it's a "try-catch" template.

Upvotes: 112

Related Questions