Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The SRP Button Control allows developers to set an icon for each button state, but the mechanism for doing so is not obvious when just looking at the property names. In understand how the icons are establish, we must first understand the concept of image frames.

Image Frames

Both the Icon and IconList properties allow you to establish a frame count. The frame count is used to determine how the loaded image file is divided into a list of smaller images, or frames. The easiest way to see this is by example. Here is a single image file, 288 pixels wide and 27 pixels tall.

...

The frame count is set within the Icon and IconList properties, usually as a field or subvalue. For example, to load our sample image, we use this code:

...

In short, you may include as many or as few frames as you wish and the SRP Button Control is smart enough to adapt.

See Also

IconIconList