SetCurrentElement example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub TestSetCurrentElement( )
   Dim lCount As Integer
   LEADDICOM1.EnableMethodErrors = False
   'get total number of images in this Data Set
   LEADDICOM1.SetCurrentElement(0)
   lCount = LEADDICOM1.GetBitmapCount
   MessageBox.Show("Total: " & CStr(lCount))
   'move to last image tag in the Data Set
   LEADDICOM1.FindLastElement(LTDICLib.DicomDataSetTagConstants9.TAG_PIXEL_DATA, False)
   'get total number of images in this tag
   lCount = LEADDICOM1.GetBitmapCount
   MessageBox.Show("This tag: " & CStr(lCount))
End Sub