Drawing Owner-drawn Items

From RAD Studio
Jump to: navigation, search

Go Up to Adding Graphical Objects to a String List

When you indicate that a control is owner-drawn, either by setting a property or supplying a custom draw event handler, the control is no longer drawn on the screen. Instead, the operating system generates events for each visible item in the control. Your application handles the events to draw the items.

To draw the items in an owner-draw control, do the following for each visible item in the control. Use a single event handler for all items.

  1. Size the item, if needed. Items of the same size (for example, with a list box style of lsOwnerDrawFixed), do not require sizing.
  2. Draw the item.

See Also