SetCurrentElement example for C#

//LEADDICOM1 is a DICOM Dataset defined outside this method
private void TestSetCurrentElement( )
{
   int lCount = 0;
   LEADDICOM1.EnableMethodErrors = false;

   //get total number of images in this Data Set
   LEADDICOM1.SetCurrentElement(0);
   lCount = LEADDICOM1.GetBitmapCount();
   MessageBox.Show("Total: " + System.Convert.ToString(lCount));

   //move to last image tag in the Data Set
   LEADDICOM1.FindLastElement((int)LTDICLib.DicomDataSetTagConstants9.TAG_PIXEL_DATA, false);

   //get total number of images in this tag
   lCount = LEADDICOM1.GetBitmapCount();
   MessageBox.Show("This tag: " + System.Convert.ToString(lCount));
}