Ejemplo n.º 1
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (fileName != null)
     {
         DialogResult res = MessageBox.Show("Bạn có muốn xóa file " + fileName + " Không ?", "Thông Báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (res == DialogResult.OK)
         {
             Mp3Player.Exit();
             File.Delete(fileName);
             LoadListview();
         }
     }
 }
Ejemplo n.º 2
0
        private void ListView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListView lv = sender as ListView;

            if (lv.SelectedItems.Count > 0)
            {
                fileName = "DataMedia/Music/" + lv.SelectedItems[0].Text;
                Mp3Player.Exit();
                Mp3Player.open(fileName);
                Mp3Player.Volume(trackBar.Value * 10);
                Mp3Player.play();
            }
        }