如何实现播放音乐进度显示在ProgressBar上
展开全部
实现的代码为:
private void GetData()
{
string strConn = "Data Source=.;Initial Catalog=dbXXX;User ID=sa;pwd=";
SqlConnection con = new SqlConnection(strConn);
SqlDataAdapter da = new SqlDataAdapter("select * from tableX", con);
DataSet ds = new DataSet();
da.Fill(ds);
int count = ds.Tables[0].Rows.Count;
progressBar1.Minimum = 0;
progressBar1.Maximum = 100;
progressBar1.BackColor = Color.Green;
for (int i = 0; i < count; i++) //为了能看出效果 用for循环来减低速度
{
for (int j = 0; j < 1000; j++)
{
if (Convert.ToInt32(ds.Tables[0].Rows[i]["***"].ToString()) > 20)
cc++;
}
progressBar1.Value = ((i + 1) * 100 / count);
}
dataGridView1.DataSource = ds.Tables[0];
}
private void GetData()
{
string strConn = "Data Source=.;Initial Catalog=dbXXX;User ID=sa;pwd=";
SqlConnection con = new SqlConnection(strConn);
SqlDataAdapter da = new SqlDataAdapter("select * from tableX", con);
DataSet ds = new DataSet();
da.Fill(ds);
int count = ds.Tables[0].Rows.Count;
progressBar1.Minimum = 0;
progressBar1.Maximum = 100;
progressBar1.BackColor = Color.Green;
for (int i = 0; i < count; i++) //为了能看出效果 用for循环来减低速度
{
for (int j = 0; j < 1000; j++)
{
if (Convert.ToInt32(ds.Tables[0].Rows[i]["***"].ToString()) > 20)
cc++;
}
progressBar1.Value = ((i + 1) * 100 / count);
}
dataGridView1.DataSource = ds.Tables[0];
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询