473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ProgressBar question

Hi,

I have a function that copys a file, and I would like to use a ProgressBar, but i can't find a good example anywhere. The one in the help files uses a copy function that returns a value. Maybe if I knew how to do that........Anyway, any help is appreciated.

Steve
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim srcPath, destPath, dirvar As String
srcPath = Application.StartupPath & "\punch.MDB"
destPath = "c:\_Test\punch.mdb"
dirvar = "c:\_Test"
Try
If Directory.Exists(dirvar) Then
File.Copy(srcPath, destPath)
Else
Directory.CreateDirectory(dirvar)
File.Copy(srcPath, destPath)
End If

Catch ex As Exception

End Try
End Sub
Nov 20 '05 #1
1 826
Cor
Hi Steve

In this function you cannot use a progresbar.
The only thing you could do is show a "busy" text before and change that
with a "ready" text (or use icons, gifs whatever)..

There is no interaction in your program in those statements you use.
It starts and goes to the next program instruction only when it is ready or
throws an error.

I hope this helps anyway.

Cor
I have a function that copys a file, and I would like to use a ProgressBar,
but i can't find a good example anywhere. The one in the help files uses a
copy function that returns a value. Maybe if I knew how to do
that........Anyway, any help is appreciated.

Steve
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim srcPath, destPath, dirvar As String
srcPath = Application.StartupPath & "\punch.MDB"
destPath = "c:\_Test\punch.mdb"
dirvar = "c:\_Test"
Try
If Directory.Exists(dirvar) Then
File.Copy(srcPath, destPath)
Else
Directory.CreateDirectory(dirvar)
File.Copy(srcPath, destPath)
End If

Catch ex As Exception

End Try
End Sub
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Maka Sili | last post by:
Using ProgressBar.Enabled = false does not dim the progress bar. There must be a way. I hope somebody could guide me. Thanks.
2
by: jez123456 | last post by:
Hi, thanks for the previous advice on progressbars with showing the percentage. I would now like to create a less clunky version. I.e at the moment my progressbar shows 7 separate steps. Some...
8
by: needin4mation | last post by:
Please consider: foreach (ListViewItem item in listViewFiles.Items) { // Display the ProgressBar control. pBar1.Visible = true; // Set Minimum to 1 to represent the first file being copied....
1
by: Mehr H | last post by:
I've been trying to figure out how i can embed a Windows.Forms.ProgressBar in my webform (aspx) file. I have tried putting a Windows.Forms.ProgressBar as public on a regular winform designer form...
2
by: sotto | last post by:
I need a loginscreen, that will show a progressbar that changes values based on a method in the main application (loading data from database) how would i do this? (i guess i need threading for...
3
by: Mitchell Vincent | last post by:
In other programming languages I've been able to easily change the style of a progress bar between smooth and blocked. I find that is either really hidden or impossible in .NET. Am I missing...
1
by: nobody | last post by:
Hi I'm currently developing a Windows application. At the start of the application I load several tables into datatables in a dataset. I also use a progressbar to show the user how much percent...
3
by: al jones | last post by:
I have the following, extracted from my code (sorry, the files 'line' of code wraps across the first five lines of the copy) and pbFiles is (obviously?) the progressbar. Dim foundFiles As...
5
by: mamin | last post by:
I have, the following question: I have a WindowsForm with ProgressBar progressBar1 and Button button1. After onClick event on button the following method executes: button_Click(object...
4
by: Thomas | last post by:
Hello, I don't know if such question was already posted but I didn't find anything through different posts. I have the Main MDI window with a StatusBar. Inside my StatusBar there is a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.