| | |
Threaded Backup Utility
Please support our VB.NET advertiser: Intel Parallel Studio Home
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 2005 2008 access account advanced array basic beginner browser button buttons center check code combo crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel fade filter forms ftp generatetags gridview html images input insert intel internet listview map mobile monitor net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem save searchbox searchvb.net select serial settings shutdown soap socket sqlserver survey table tcp temperature textbox timer timespan transparency trim txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode year





