i can get the song to play but when i click the link on my gui called rap it opens up the file directory and ask me to seleted the file i want to play but i would like it to know what file i want to play say 2Pac from the file directory
how can i change my code to suit this:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Media;
namespace musicChoice
{
public partial class frmMusicPlayer : Form
{
public frmMusicPlayer()
{
InitializeComponent();
}
private void frmMusicPlayer_Load(object sender, EventArgs e)
{
}
private void btnPause_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.pause();
}
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void btnStop_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.stop();
}
private void LLRap_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
// Diectory of the music i want to play
dlg.InitialDirectory = @"F:\Uni work\Com321 derek Week2 programing ex\LastCodeProjectc#\musicChoice 2pac";
dlg.CheckFileExists = true;
dlg.Multiselect = false;
dlg.Filter = "Media Files(*.avi;*.mp3;*.mpg;*.mpa)" +
"|*.avi;*.mp3;*.mpg;*.mpa|" +
"All files (*.*)|*.*";
if (dlg.ShowDialog() == DialogResult.OK)
{
axWindowsMediaPlayer1.URL = dlg.FileName;
}
}
}
}

New Topic/Question
Reply




MultiQuote





|