IncludeVolatile Example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
'This example uses the predefined variable "List1" of type "ListBox" from ".NET Framework".
'This example uses the predefined variable "List2" of type "ListBox" from ".NET Framework".
Private Sub TestIncludeVolatile ( )
   Dim nRet As Short

   LEADDICOM1.EnableMethodErrors = False
   'list all elements
   LEADDICOM1.IncludeVolatile = True
   nRet = LEADDICOM1.MoveFirstElement(False)
   While (nRet = 0)
      List1.Items.Add(CStr(LEADDICOM1.CurrentElement.Tag))
      nRet = LEADDICOM1.MoveNextElement(False)
   End While
   MessageBox.Show("Element Count = " & CStr(List1.Items.Count))
   'list only non-volatile elements
   LEADDICOM1.IncludeVolatile = False
   nRet = LEADDICOM1.MoveFirstElement(False)
   While (nRet = 0)
      List2.Items.Add(CStr(LEADDICOM1.CurrentElement.Tag))
      nRet = LEADDICOM1.MoveNextElement(False)
   End While
   MessageBox.Show("Non Volatile Element Count = " & CStr(List2.Items.Count))
End Sub