MoveFirstVR Example for Visual Basic
Private Sub Command10_Click()
LEADDICOM1.EnableMethodErrors = True
On Error GoTo MOVEVRERROR
LEADDICOM1.MoveFirstVR
DisplayItem
MsgBox "wait"
LEADDICOM1.MoveNextVR
DisplayItem
MsgBox "wait"
LEADDICOM1.MoveLastVR
DisplayItem
MsgBox "wait"
LEADDICOM1.MovePrevVR
DisplayItem
MsgBox "wait"
MOVEVRERROR:
End Sub
Private Sub DisplayItem()
Dim nRestrict As Integer
LEADDICOM1.EnableMethodErrors = True
On Error GoTo DISPLAYERROR
'display the items information
Select Case LEADDICOM1.CurrentVR.Code
Case VR_AE
Text1.Text = "AE"
Case VR_AS
Text1.Text = "AS"
Case VR_AT
Text1.Text = "AT"
Case VR_CS
Text1.Text = "CS"
Case VR_DA
Text1.Text = "DA"
Case VR_DS
Text1.Text = "DS"
Case VR_DT
Text1.Text = "DT"
Case VR_FD
Text1.Text = "FD"
Case VR_FL
Text1.Text = "FL"
Case VR_IS
Text1.Text = "IS"
Case VR_LO
Text1.Text = "LO"
Case VR_LT
Text1.Text = "LT"
Case VR_OB
Text1.Text = "OB"
Case VR_OW
Text1.Text = "OW"
Case VR_PN
Text1.Text = "PN"
Case VR_SH
Text1.Text = "SH"
Case VR_SL
Text1.Text = "SL"
Case VR_SQ
Text1.Text = "SQ"
Case VR_SS
Text1.Text = "SS"
Case VR_ST
Text1.Text = "ST"
Case VR_TM
Text1.Text = "TM"
Case VR_UI
Text1.Text = "UI"
Case VR_UL
Text1.Text = "UL"
Case VR_UN
Text1.Text = "UN"
Case VR_US
Text1.Text = "US"
Case VR_UT
Text1.Text = "UT"
Case Else
Text1.Text = CStr(LEADDICOM1.CurrentVR.Code)
End Select
Text2.Text = LEADDICOM1.CurrentVR.Name
Text3.Text = CStr(LEADDICOM1.CurrentVR.Length)
nRestrict = LEADDICOM1.CurrentVR.Restrict
nRestrict = (nRestrict And (Not DICOM_VR_BINARY))
nRestrict = (nRestrict And (Not DICOM_VR_STRING))
nRestrict = (nRestrict And (Not DICOM_VR_TEXT))
Select Case nRestrict
Case DICOM_VR_FIXED
Text4.Text = "Fixed"
Case DICOM_VR_MAXIMUM
Text4.Text = "Maximum"
Case DICOM_VR_MAXIMUM_GROUP
Text4.Text = "Maximum Group"
Case DICOM_VR_ANY
Text4.Text = "Any Length"
Case DICOM_VR_NOT_APPLICABLE
Text4.Text = "Not Applicable"
Case DICOM_VR_MAX
Text4.Text = "Max"
Case Else
Text4.Text = CStr(LEADDICOM1.CurrentVR.Restrict)
End Select
Text5.Text = CStr(LEADDICOM1.CurrentVR.UnitSize)
DISPLAYERROR:
End Sub