Hi, I've got a progressbar in my form that I want to increase the value of in increments based on number of files in a folder.
I guess this is pretty basic, but this kind of programming is pretty new to me.
So I've got these lines of code:
Dim directory As New IO.DirectoryInfo("C:\Temp")
Dim arrayFiles as IO.FileInfo() = directory.GetFiles("*.txt")
Dim fi As IO.FileInfo
For Each fi In arrayFiles
Do stuff
ProgressBar.Value = "something"
Next
I'd appreciate any help at all! :)
Edit: I got it working by doing this (probably a stupid way of doing it though)
For Each fi In arrayFiles
ProgressBar.Value = ProgressBar.Value + arrayFiles.Length / arrayFiles.Length
Next
Edit2: Come to think of it, arrayFiles.length / arrayFiles.length = 1 .. So i could just have typed 1 then.
And, perhaps pretty important, I've set the ProgressBar.Maximum = arrayFiles.Length