TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guingab Maricar
NA
24
0
custom progress bar in a datagridview with threading
Oct 17 2008 3:50 AM
I am creating a program similar to a download manager. In my form(DownloadManagerForm.cs) I already created a datagridview with a custom progress bar(i found out i have to create classes called DataGridViewProgressColumn and DataGridViewProgressCell because datagridview does not support other controls). In my other class (BHO) i have to activate the DownloadManagerForm automatically and use a thread so it can facilitate multiple downloading. I used the Invoke method and a certain Callback. I noticed that when i run the program the progress bar starts with 0 then 100.I want to see the progress bar move slowly or at least see it move somehow. Please tell me what to add with my code.. Thanks
columnGraphics = new DataGridViewProgressColumn();
dataGridView1.Rows.Add(columnGraphics);
thrDownload = new Thread(Download);
thrDownload.Start();
-----------------------------------------------
Download()
{
.
.
.
this.Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { strLocal.Length, fileSize });
}
--------------------------------------
UpdateProgress
{
int PercentProgress = Convert.ToInt32((BytesRead * 100) / TotalBytes);
updatedProgress = ((float)PercentProgress);
Graphics.CellTemplate.Value = updatedProgress;
}
.
.
.
Class
DataGridViewProgressColumn and DataGridViewProgressCell
Reply
Answers (
1
)
Reading excel using windows service
datetime question