ViewSize example for C++ Builder

   long nSize;
   long nFirst;
   long nLast;
   long nCols;
   long nCount;

   //NOTE: assume scroll style = SCROLLSTYLE_VERTICAL
   //get the view size
   nSize = LEADImgList1->ViewSize;
   //get the first visible item
   nFirst = LEADImgList1->FirstVisibleItem;
   //get the column count
   nCols = LEADImgList1->ColumnCount;
   //calculate the index of last visible item
   nLast = nFirst + (nSize * nCols) - 1; //0 based index
   nCount = LEADImgList1->Count;
   if (nLast > nCount - 1)
      nLast = nCount - 1;