PC Review


Reply
Thread Tools Rate Thread

Do something while copying

 
 
carmen
Guest
Posts: n/a
 
      8th Sep 2004
Is it possible to show some movement in the screen while copying a file?
I tried to use a timer that change the position of an image but when I start
the copy of a file from diskette all is stopped until the copy finishes.
Any ideas? Thank you


 
Reply With Quote
 
 
 
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      8th Sep 2004
carmen <(E-Mail Removed)> wrote:
> Is it possible to show some movement in the screen while copying a file?
> I tried to use a timer that change the position of an image but when I start
> the copy of a file from diskette all is stopped until the copy finishes.
> Any ideas? Thank you


You need to copy the file in a different thread.

See http://www.pobox.com/~skeet/csharp/threads

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
carmen gonzalez
Guest
Posts: n/a
 
      8th Sep 2004


OK, I did but need to know when the copy is finished in order to stop
the timer that moves the image and I don't know how to do this.
Thank you for your help.
Carmen

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      8th Sep 2004
carmen gonzalez <(E-Mail Removed)> wrote:
> OK, I did but need to know when the copy is finished in order to stop
> the timer that moves the image and I don't know how to do this.


You would use Control.Invoke from the second thread to call a method on
the UI thread.

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
carmen gonzalez
Guest
Posts: n/a
 
      8th Sep 2004


Sorry Jon but I don't know how to do that.
this is my code

Thread Copy = new Thread(new(ThreadStart(CopyDisk));

static public void CopyDisk()
{
File.Copy(path1,path2,true);
}
...
private void button1_Click(object sender, System.EventArgs e)
{
Copy.Start();
}

Thank you for all your help.
Carmen

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      8th Sep 2004
carmen gonzalez <(E-Mail Removed)> wrote:
> Sorry Jon but I don't know how to do that.


That's why I gave you a link to an article before which goes through it
all in detail. Please read it all - particularly the Windows Forms
section - and then come back if you've got any further questions.

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying sheets without copying named ranges NMACK08 Microsoft Excel Programming 1 5th Feb 2008 08:53 PM
Which is faster, copying range to another set of ranges or copying tomemory? axwack Microsoft Excel Programming 2 12th Dec 2007 01:19 PM
copying the Hyperlink function result without copying the actual formula mcheng Microsoft Excel Worksheet Functions 2 9th Jun 2007 02:43 AM
Copying the filtered data to clipboard is copying non-visible rows =?Utf-8?B?U2VldGhhUmFtYW4=?= Microsoft Excel Crashes 10 12th Jul 2006 09:39 PM
Debuggin and Shadow Copying. How to avoid copying dll in temp fold =?Utf-8?B?TWljaGFlbCBOZW10c2V2?= Microsoft C# .NET 4 1st Mar 2006 08:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:46 PM.