每日站立会议 11。21

今天的任务是写出关于下一首的代码,然后调试是否合格,修改毛病

private void button7_Click(object sender,System.EventArgs e)
{//下一首歌曲
if(this .listView1.Items.Count>0)
{
if(this.listView1.SelectedItems.Count>0)
{
int ipos=this.listView1.SelectedItems[0].Index;
if(ipos>0)
{
this.listView1.Items[ipos+1].Selected=true;
string         FileName=this.listView1.Items[ipos-1].SubItems[3].Text;
this.axMediaPlayer1.FileName=FileName;
this.axMediaPlayer1.Play();
}
else
{
MessageBox.Show("已经是第一首歌曲!","信息提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
}
else
{
MessageBox.Show("请选择歌曲","信息提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}

猜你喜欢

转载自www.cnblogs.com/chenvc/p/9997920.html