Adding a Toolbox Bitmap

Before this chapter ends, I'd like to add a Toolbox bitmap for the IconButton. A Toolbox bitmap is the 16×16 image that appears in the Toolbox tab for the IconButton. Adding a bitmap for a control is a simple task, to say the least. All that needs to be done is to add a bitmap with the same name as the control to the project. Figure 3.7 shows the Solution with the IconButton.bmp file added in the Controls folder of the Solution.

Figure 3.7. The IconButton.bmp file.

The bitmap must reside in the same namespace as the control and be compiled as an embedded resource. The Toolbox uses this as the default search for locating ...

Get .NET Windows® Forms Custom Controls now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.