Manipulating a Data Set Using the LEADTOOLS DICOM OCX Control for VB.NET

'LEADDicomDS is a DICOM Dataset defined outside this method
Private Sub TestManipulatingDataSetUsingLEADTOOLSDICOMOCXControl()

   ' The following code snippet demonstrates how to use the LEADTOOLS DICOM   
   ' DS COM Object (ILEADDicomDS) to get the Value of the Implementation Class   
   ' UID element of a DICOM Directory

   Dim DicomDir As New LTDICDIRLib.LEADDicomDir   
   Dim nRetValue As Short

   ' Load a DICOMDIR File   
   nRetValue = DicomDir.LoadDicomDir("C:\Medical Images\DICOMDIR", LTDICLib.DicomDataSetFlags.DS_LOAD_CLOSE)

   If nRetValue = LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS Then      
      LEADDicomDS.hDicomDS = DicomDir.hDicomDirDS      
      nRetValue = LEADDicomDS.FindFirstElement(LTDICLib.DicomDataSetTagConstants1.TAG_IMPLEMENTATION_CLASS_UID, False)      
      If nRetValue = LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS Then         
         LEADDicomDS.GetConvertValue()

         ' Display the value of the element         
         MessageBox.Show(LEADDicomDS.StringValues(0))

         LEADDicomDS.StringValueCount = 0      
      End If   
   End If
End Sub