Microsoft Visual Studio provides powerful features helping in rapid code development and makes developers productive. In this article introducing one such feature that reduces expensive copy-paste operations when there is a same piece code snippet to be reused in multiple code blocks. Yes, it’s about how to store and use reusable code from the Visual Studio tool box.
For example: Suppose if you need to add trace log-related code in each code block, then most of the time, you copy the existing line of a code that you already wrote in some code file. Copy and paste operation is expensive when there is a common code to be written across the project.
Store and use reusable code from Visual Studio toolbox:
In Visual Studio, you can keep this piece of code in the toolbox, and you can reuse this code when required. You need to drag and drop the code line from the toolbox to your code editor pane. This is similar to drag-drop Button control to form.
Follow the below steps to see how to move code snippets into the toolbox in Visual Studio.
– Article ends here –