ConformanceStatus example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub LEADDICOM1_ConformanceStatus(ByVal nFlags As Short) Handles LEADDICOM1.ConformanceStatus
   Dim msg As String
   Dim nRet As Short
   Dim szTag As String
   Dim szTagL As String
   Dim szTagR As String
   Dim nLen As Short
   Dim x As Short

   'display info about non-standard element
   Select Case nFlags
      Case LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_UNKNOWN_CLASS
         msg = "Unknown Class" & Chr(13)
      Case LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_UNKNOWN_TAG
         msg = "Unknown Tag" & Chr(13)
      Case LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_UNKNOWN_VR
         msg = "Unknown VR" & Chr(13)
      Case LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_WRONG_VR
         msg = "Error in VR" & Chr(13)
      Case LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_MIN_VM
         msg = "Error in MinVM" & Chr(13)
      Case LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_MAX_VM
         msg = "Error in MaxVM" & Chr(13)
      Case LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_DIVIDE_VM
         msg = "Error in DivideVM" & Chr(13)
      Case LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_IMAGE
         msg = "Error in Image" & Chr(13)
      Case Else
      Exit Sub
   End Select

   szTag = Hex(LEADDICOM1.CurrentElement.Tag)
   nLen = Len(szTag)
   szTagR = szTag.Substring(0, nLen - 4)
   szTagL = ""

   For x = nLen To 7
      szTagL = szTagL & CStr(0)
   Next

   szTagL = szTagL & szTag.Substring(0, nLen - 4)
   szTag = szTagL & ":" & szTagR
   msg = msg & "Tag: " & szTag

   nRet = MessageBox.Show(msg, MsgBoxStyle.OKCancel, "Non-Standard Element")
   If (nRet = DialogResult.Cancel) Then
      LEADDICOM1.EnableConformanceStatus = False
   End If
End Sub