Skip to Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
Customize the Toolbox #27
Chapter 4, Customizing Visual Studio
|
111
HACK
If you are building your own control, it’s easy to add a cus-
tom toolbox icon: create a 16 × 16 bitmap and add it to your
project. You will need to ensure that the name of the bitmap
is the same as the name of the control and the bitmap is set
to be an embedded resource.
Code Snippets and the Toolbox
The normal use of the toolbox includes adding and removing tabs and con-
trols, but you can also use the toolbox to store code snippets. Whether you
want to store a method call to get a connection string, a commonly used
piece of JavaScript, or an architecture-specific piece of code, the toolbox is a
great place to save those pieces of code that you constantly find yourself typ-
ing.
Before adding any code snippets to the toolbox, it is a good idea to add a
separate tab to the toolbox for your code snippets: right-click on the tool-
box and select Add Tab, then enter a name for the tab (such as
Code
Snippets
) in the text box that appears at the bottom of the toolbox.
Storing a piece of code in the toolbox is simple: select the code from the
document window and drag it over to the toolbox. After dropping the code
on the toolbox, you will see a snippet like the one shown in Figure 4-15.
This code snippet can now be dragged and dropped from the toolbox to the
document window, and the included code will be pasted into the docu-
ment. You ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Mastering Visual Studio .NET

Mastering Visual Studio .NET

Chris Sells, Ian Griffiths, Jon Flanders
C# 4.0 Unleashed

C# 4.0 Unleashed

Bart De Smet
Programming in the .NET Environment

Programming in the .NET Environment

Damien Watkins, Mark Hammond, Brad Abrams

Publisher Resources

ISBN: 0596008473Errata Page