Page 2 of 2

Re: Copying multiple files ( help )

Posted: Sun Jul 15, 2012 6:31 pm
by CodenBoy
Thanks man!!!
loove;

i will ask this simple question here because i dont want to start new topic = waste of space of site so this the question

Can I put a label ( Files Remaining: and the number of files needs to be copied ?
maybe this will work or no idk just asking if its then what the code?

Thanks

Best programmer for ever is Begoh7!!

Re: Copying multiple files ( help )

Posted: Sun Jul 15, 2012 6:42 pm
by comathi
You could use this (I already inserted it in Bogoh's code, so you can just use as is ;) )
Code: Select all
  ProgressBar1.Maximum = ListBox1.Items.Count
  Dim itemCount As Integer = ListBox1.Items.Count
  Dim itemMax As Integer = ListBox1.Items.Count
  Label1.Text = Convert.ToString(itemCount) & " items remaining on " & Convert.ToString(itemMax) & " items."
        For i As Integer = 0 To ListBox1.Items.Count - 1
            Dim thestrings() As String = ListBox1.Items(i).ToString.Split("\")
            Dim filename As String = thestrings(thestrings.Length - 1)
            FileCopy(ListBox1.Items(i), "C:\Test\" & filename)
            ProgressBar1.Value = i + 1
            itemCount -=1
            Label1.Text = Convert.ToString(itemCount) & " items remaining on " & Convert.ToString(itemMax) & " items."
        Next
        MsgBox("File Completed Copying", MsgBoxStyle.Information, "Done!")

Re: Copying multiple files ( help )

Posted: Sun Jul 15, 2012 6:46 pm
by CodenBoy
thanks for ur help comathi :)
EDIT: it stays 0 out of 20 or anything
it stays "0" not changing :o

Re: Copying multiple files ( help )

Posted: Sun Jul 15, 2012 6:48 pm
by comathi
Would you by any chance have TeamViewer? It might be easier for me, or anyone else for that matter, to help you if they can actually see how you placed the code.

Re: Copying multiple files ( help )

Posted: Sun Jul 15, 2012 6:51 pm
by CodenBoy
Sure, i sent you my teamviewer id and password by PM

Thanks loove;

Re: Copying multiple files ( help )

Posted: Sun Jul 15, 2012 7:14 pm
by Bogoh67
#comathi shouldnt it be Label1.Text = i & " items remaining on " & Convert.ToString(itemMax) & " items."

Re: Copying multiple files ( help )

Posted: Sun Jul 15, 2012 7:46 pm
by CodenBoy
Thanks bogoh and comathi,
you both helped me alot