110,538
社区成员
发帖
与我相关
我的任务
分享
private void timer1_Tick(object sender, EventArgs e)
{
if ((int)wmpPlay.playState == 1)
{
if (Index < 2)
{
Index++;
}
else
{
Index = 0;
}
this.Set_Play();
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
this.Set_Play();
if (checkBox1.Checked == true)
{
timer1.Start();
}
else
{
timer1.Stop();
}
}
private void Set_Play()
{
if (checkBox1.Checked == true)
{
if (Index == 0)
{
wmpPlay.URL = "D:\\我的音乐\\少儿歌曲\\星仔走天涯.mp3";
}
else if (Index == 1)
{
wmpPlay.URL = "D:\\我的音乐\\少儿歌曲\\好爸爸坏爸爸.mp3";
}
else
{
wmpPlay.URL = "D:\\我的音乐\\少儿歌曲\\泥娃娃.mp3";
}
}
else
{
wmpPlay.close();
}
}