Adding Graphics to Controls

From RAD Studio
Jump to: navigation, search

Go Up to Working with Controls Index

Several controls let you customize the way the control is rendered. These include list boxes, combo boxes, menus, headers, tab controls, list views, status bars, tree views, and toolbars. Instead of using the standard method of drawing a control or its items, the control's owner (generally, the form) draws them at run time. The most common use for owner-draw controls is to provide graphics instead of, or in addition to, text for items. For information on using owner-draw to add images to menus, see Adding Images to Menu Items.

All owner-draw controls contain lists of items. Usually, those lists are lists of strings that are displayed as text, or lists of objects that contain strings that are displayed as text. You can associate an object with each item in the list to make it easy to use that object when drawing items.

In general, creating an owner-draw control involves these steps:

  1. Indicating that a control is owner-drawn.
  2. Adding graphical objects to a string list.
  3. Drawing owner-drawn items.


See Also