Hey
I use VB.NET 2005 and your latest Controls
Is it possible to show the status of a script in a progressbar?
If possible please give me a VB Sample.
THX
Script & Progressbar
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
Here is a small sample, though it's written in C# I hope you can easily get the idea.Basically, what you need is to wire to the MySqlStatementExecute event of MySqlScript.
Here you recalculate the progressBar.Value property and increment a row counter (counter++).
It's quite straight-forward, but if you have any questions just go ahead.
Code: Select all
private int counter = 1;
private int all = 0;
private void Form1_Load(object sender, EventArgs e) {
all = mySqlScript1.Statements.Count;
mySqlConnection1.Open();
mySqlScript1.Execute();
}
private void mySqlScript1_MySqlStatementExecute(object sender, CoreLab.MySql.MySqlStatementExecuteEventArgs e) {
progressBar1.Value = (int)(double)counter / all * 100;
counter++;
}
Here you recalculate the progressBar.Value property and increment a row counter (counter++).
It's quite straight-forward, but if you have any questions just go ahead.
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24