/*
OnMeasureItem example
Here is a typical handler for an OnMeasureItem event. The example assumes that a variable owner-draw list box already has bitmaps associated with each of its strings. It sets the height of the item to the height of the associated bitmap if that height is greater than the default height.
Note that TWinControl can also be used in place of TWidgetControl on Windows.
*/ 
void __fastcall TForm1::ListBox1MeasureItem(TWidgetControl *Control, int Index, int &Height)
{
  TBitmap *pBitmap = (TBitmap *)((TListBox *)Control)->Items->Objects[Index];
  if (Bitmap && Bitmap->Height > Height)
    Height = Bitmap->Height;
}
 
