J
johnb41
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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnConfirmNext.Click
Dim fi As New FileInfo("c:\test.tif")
Dim di As DirectoryInfo = fi.Directory
Dim NextImage As IEnumerator
NextImage = di.GetFiles.GetEnumerator
NextImage.MoveNext()
Dim fi2 As FileInfo = NextImage.Current
MessageBox.Show(fi2.Name)
'I was hoping fi2.name would yield the "NEXT" filename
'in the folder. Instead it gives me "c:\test.tif"
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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnConfirmNext.Click
Dim fi As New FileInfo("c:\test.tif")
Dim di As DirectoryInfo = fi.Directory
Dim NextImage As IEnumerator
NextImage = di.GetFiles.GetEnumerator
NextImage.MoveNext()
Dim fi2 As FileInfo = NextImage.Current
MessageBox.Show(fi2.Name)
'I was hoping fi2.name would yield the "NEXT" filename
'in the folder. Instead it gives me "c:\test.tif"
End Sub
My approach for this is probably way off. Can anyone help?
Thanks!
John