ICONS

Each form in a Visual Basic application has its own icon. A form’s icon is displayed on the left side of its title bar, in the system’s taskbar, and by applications such as the Task Manager and Windows Explorer.

Some of these applications display icons at different sizes. For example, Windows Explorer uses 32 × 32 pixel icons for its Large Icons view and 16 × 16 pixel icons for its other views. Toolbar icons come in 16 × 16, 24 × 24, and 32 × 32 pixel sizes. Windows uses still other sizes for different purposes. For more information on various pixel sizes used by Windows Vista, see http://msdn2.microsoft.com/aa511280.aspx.

If an icon file doesn’t provide whatever size Windows needs, the system shrinks or enlarges an existing image to fit. That may produce an ugly result. To get the best appearance, you should ensure that icon files include at least 16 × 16 and 32 × 32 pixel sizes. Depending on the characteristics of your system, you may also want to include other sizes.

The integrated Visual Studio icon editor enables you to define images for various color models ranging from monochrome to 24-bit color, and sizes ranging from 16 × 16 to 256 × 256 pixels. It even lets you build icon images with custom sizes such as 32 × 48 pixels, although it is unlikely that Windows will need to use those.

To use this editor, open Solution Explorer and double-click the My Project entry to open the Project Properties window. Select the Resources tab, open the Add Resource drop-down, and select ...

Get Visual Basic 2012 Programmer's Reference 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.