DeleteVR Example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub TestDeleteVR()
   Dim nCode As Short
   Dim lIndex As Integer

   LEADDICOM1.EnableMethodErrors = True
   On Error GoTo DELETEVRERROR
   nCode = 18771
   'move to the selected VR
   LEADDICOM1.FindVR(nCode)
   'delete it
   LEADDICOM1.DeleteVR()

   Exit Sub

DELETEVRERROR:
   MessageBox.Show("Error")

End Sub