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
Murali Kris
1.5k
254
48.4k
how to use progress bar for custom code..
Nov 19 2018 3:53 AM
Hi,
As of now with below script i can able to get my data as expected.
1. Connecting server(site).
2. Getting some content(site content).
a: Here calling another method for get site content and display gridview
b:using threading for UI Freez(UI Responcive).
please find below button_1 code
private void button1_Click(object sender, EventArgs e)
{
Thread threadcall = new Thread(() =>
{
lists(); // this is calling function to get site contents
Action action = new Action(finalsms);
this.BeginInvoke(action);
});
threadcall.Start();
label10.Text = "Loading lists please wait...";
}
private String lists() // function here for get site contents
{
//my custom script for load site content
foreach (var list in coll)
{
var dr = dt.NewRow();
dr["List Names"] = list.Title;
dt.Rows.Add(dr);
}
dataGridView1.DataSource = dt;
return string.Empty;
}
as of now i can able to get as expted output. but i want to add progress bar to show background process status on progress bar.
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
// what code i need do add here if list finction i need to add,
//if list() function code , yes i tryied alredy but no luck.
}
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{// what is the code that i need to add here
}
Reply
Answers (
3
)
how to get 1st column value in spreadsheet Document in mvc
Closing socket object not releasing port no in C#.