| | |
Threaded Backup Utility
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
I have a backup utility that copies all files and folder into a backup area
This can take some time as the files take up 92Mb over a 1Mbps Data Link
I have added multi-threading to the utility so that the copy can be aborted and so the GUI keeps active.
but i would like to add a progress bar based on the current number of files copied.
The only problem is that the only area that can access the progress bar is the Main Thread which is not the Thread doing the file copies.
Is there any way to put the Progress bar in the copying thread, Access the forms control from another thread or create a new form control that is on the Form but generated by the Copying Thread?
This can take some time as the files take up 92Mb over a 1Mbps Data Link
I have added multi-threading to the utility so that the copy can be aborted and so the GUI keeps active.
but i would like to add a progress bar based on the current number of files copied.
The only problem is that the only area that can access the progress bar is the Main Thread which is not the Thread doing the file copies.
Is there any way to put the Progress bar in the copying thread, Access the forms control from another thread or create a new form control that is on the Form but generated by the Copying Thread?
•
•
•
•
Is there any way to put the Progress bar in the copying thread, Access the forms control from another thread or create a new form control that is on the Form but generated by the Copying Thread?
What you need to do is access the controls through a dummy interface that calls Invoke on the control instead of manipulating it directly if it's not on the main thread. vbnet Syntax (Toggle Plain Text)
Delegate Sub SetProgressPropertyCallback( ByVal property As String, ByVal value As Integer ) Private Sub SetProgressProperty( ByVal property As String, ByVal value As integer ) If ProgressBar1.InvokeRequired Then Dim d As New SetProgressPropertyCallback( AddressOf SetProgressProperty ) Me.Invoke( d, New Object() { property, value } ) Else Select Case property Case "Value" ProgressBar1.Value = value Case "Max" ProgressBar1.Maximum = value Case "Min" ProgressBar1.Minimum = value End Select End If End Sub
The truth does not change according to our ability to stomach it.
![]() |
Similar Threads
- Manually Install Backup in Windows XP Home Edition (Windows tips 'n' tweaks)
- Problem with Backup Utility In Vista (Windows Vista and Windows 7)
- cannot backup to CD-ROM (Windows NT / 2000 / XP)
- Use Backup to Restore Files and Folders on Your Computer in Windows XP (Windows tips 'n' tweaks)
- Backup routines, with Windows or Norton Ghost (Windows NT / 2000 / XP)
- Windows 2000 Backup Utility Tape Error (Windows NT / 2000 / XP)
- Use Backup to Back Up Files and Folders on Your Computer in Windows XP (Windows tips 'n' tweaks)
- Format Backup Drives with NTFS (Windows tips 'n' tweaks)
Other Threads in the VB.NET Forum
- Previous Thread: Many-to-one relationships
- Next Thread: Database not found error
| Thread Tools | Search this Thread |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic beginner browser button buttons center check code component connectionstring crystalreport cuesent data database databasesearch datagrid datagridview date datetimepicker design designer dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter folder forms ftp generatetags hardcopy html images input insert intel monitor net networking open output panel passingparameters peertopeervideostreaming picturebox picturebox1 port printing problem problemwithinstallation project reports" searchvb.net select serial settings shutdown sqlserver survey tcp temperature text textbox timespan toolbox transparency trim updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio.net visualstudio2008 web winforms wpf wrapingcode year





