Madhawa Learns To Blog

.net, c#, sql, OOAD and more mad memory dumps...

Thursday, June 30, 2005

Use code snippets in Visual Studio 2005

Visual Studio 2005 provides a cool feature called code snippets. We can use code snippet to type a short alias, and then expand it into a common programming construct. Code snippets can make writing program code quicker, easier, and more reliable.

U can use this feature in 2 ways. You can just create a programming construct and write code inside it or select lines of codes and then create a code snippet to surround that.

To create an empty snippet all u have to do is type a short name for the alias — a code snippet shortcut — then press TAB. To use IntelliSense menu u can press CTRL+K, then X. This will activate code snippet IntelliSense menu and u can select and press tab to insert that.

To surround with code snippets just select lines u wanna surround and press CTRL+R, then S. That’s all.

After u enter code snippet it will highlights editable areas and u can use tab to navigate trough those. And u can press enter or escape to cancel field editing and return the Code Editor to normal.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home