DeleteModule Example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub TestDeleteModule()
   Dim nRet As Short

   LEADDICOM1.EnableMethodErrors = False
   'move to the first module in the DataSet and delete it
   LEADDICOM1.FindIndexModule(0)
   nRet = LEADDICOM1.DeleteModule(LEADDICOM1.CurrentModule.Module)
   If (nRet <> 0) Then
      MessageBox.Show("Error Deleting Module!")
   End If
   LEADDICOM1.EnableMethodErrors = True
End Sub