O'Reilly logo

Developing Microsoft® .NET Controls with Microsoft Visual Basic® .NET by John Connell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a Custom Icon for Our Control

As mentioned in the previous chapter, this part is embarrassingly easy. Simply right-click the EncryptionControl project and select Add | Add Existing Item. Then navigate to any 16 x 16 bitmap file. I found a lock icon that looked like it would do the trick. I found it in C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Graphics\Icons\Misc\SECUR02B.ICO. The problem is that icons won’t work; it must be a bitmap. Note that the file must be the same name as the name of the control, except with a .bmp extension of course. Set the icon to Embedded Resource. (See Figure 7-22.)

Figure 7-22. Adding a bitmap to our Encryption Control

We know that when the control is built, the bitmap is included right ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required