![]() |
#2
tzjtzj182017-03-27 16:22
|
其中播放按钮和停止按钮代码还没完善,还有希望是点击播放或者停止按钮时,WindowsMediaPlayer控件里下一首上一首的按钮还能用;
当点击上一首或者下一首时,listBox里面的那个音乐文件随着点击上一首下一首跳动而跳动!!!!有哪位大神可以帮帮忙吗
只有本站会员才能查看附件,请 登录

using System;
using System.Collections.Generic;
using using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace _20152113509车炳进
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Mp3文件|*.mp3|Wav文件|*.wav|Wma文件|*.wma|Wmv文件|*.wmv|所有格式|*.*";
openFileDialog1.Multiselect = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
string tempFileName = "";
string fname = "";
for (int i = 0; i < openFileDialog1.FileNames.Length; i++)
{
tempFileName = openFileDialog1.FileNames.GetValue(i).ToString();
fname = tempFileName.Substring(tempFileName.LastIndexOf('\\') + 1);
try
{
axWindowsMediaPlayer1.currentPlaylist.appendItem(axWindowsMediaPlayer1.newMedia(tempFileName));
} catch{
}
listBox1.Items.Add(fname);
}
}
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Remove(listBox1.Text);
}
private void button3_Click(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
}
}
}
[此贴子已经被作者于2017-3-23 22:08编辑过]