MoveFirstIOD Example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
   Private Sub TestMoveFirstIOD()
   Dim hIOD As Integer

   LEADDICOM1.EnableMethodErrors = True

On Error GoTo MOVEIODERROR

   'Move to the First IOD in the list
   LEADDICOM1.MoveFirstIOD(False)
   hIOD = LEADDICOM1.CurrentIOD.hIOD
   'store it
   MessageBox.Show(LEADDICOM1.CurrentIOD.Name)
   'Move to the Last IOD at this same level
   LEADDICOM1.MoveLastIOD(True)
   MessageBox.Show(LEADDICOM1.CurrentIOD.Name)

   'Move to the Previous IOD at this same level
   LEADDICOM1.MovePrevIOD(True)
   MessageBox.Show(LEADDICOM1.CurrentIOD.Name)

   'Move back to First IOD
   LEADDICOM1.SetCurrentIOD(hIOD)

   'Move to the Next IOD at this same level
   LEADDICOM1.MoveNextIOD(True)
   MessageBox.Show(LEADDICOM1.CurrentIOD.Name)
   Exit Sub

MOVEIODERROR:
   MessageBox.Show("Error")

End Sub