In my application, the user opens up a Tiff image. (The file does NOT
necessarily have to be the first file in the folder; it could by
anywhere.) When i'm done viewing (doing whatever) with the image I
need to open up the "Next" Tiff file in the folder. This should be
done by clicking a button instead of using the FileOpen dialog again
and again.
Here is my approach, which isn't working:
Private Sub BtnNext_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles BtnConfirmNext. Click
Dim fi As New FileInfo("c:\te st.tif")
Dim di As DirectoryInfo = fi.Directory
Dim NextImage As IEnumerator
NextImage = di.GetFiles.Get Enumerator
NextImage.MoveN ext()
Dim fi2 As FileInfo = NextImage.Curre nt
MessageBox.Show (fi2.Name)
'I was hoping fi2.name would yield the "NEXT" filename
'in the folder. Instead it gives me "c:\test.ti f"
End Sub
My approach for this is probably way off. Can anyone help?
Thanks!
John
necessarily have to be the first file in the folder; it could by
anywhere.) When i'm done viewing (doing whatever) with the image I
need to open up the "Next" Tiff file in the folder. This should be
done by clicking a button instead of using the FileOpen dialog again
and again.
Here is my approach, which isn't working:
Private Sub BtnNext_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles BtnConfirmNext. Click
Dim fi As New FileInfo("c:\te st.tif")
Dim di As DirectoryInfo = fi.Directory
Dim NextImage As IEnumerator
NextImage = di.GetFiles.Get Enumerator
NextImage.MoveN ext()
Dim fi2 As FileInfo = NextImage.Curre nt
MessageBox.Show (fi2.Name)
'I was hoping fi2.name would yield the "NEXT" filename
'in the folder. Instead it gives me "c:\test.ti f"
End Sub
My approach for this is probably way off. Can anyone help?
Thanks!
John
Comment