每日站立会议 11.20

今日工作上一首控件的代码

private void button5_Click(object sender,System.EventArgs e)
{//停止播放
if(this.axMediaPlayer1.FileName.Length>0)
this.axMediaPlayer1.Stop();
else
{
MessageBox.show("请选择歌曲","信息提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
private void button6_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/9991793.html