Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create MusicPlayer.cs #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions MusicPlayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MusicPlayer
{
public partial class MusicPlayerApp : Form
{
public MusicPlayerApp()
{
InitializeComponent();
}

String[] paths, files;

private void btn_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Multiselect = true;
if(ofd.ShowDialog()==System.Windows.Forms.DialogResult.OK)
{
files = ofd.SafeFileNames;
paths = ofd.FileNames;

for (int i = 0; i <files.Length; i++)
{
listBoxSongs.Items.Add(files[i]);
}
}
}

private void listBoxSongs_SelectedIndexChanged(object sender, EventArgs e)
{
axWindowsMediaPlayerMusic.URL = paths[listBoxSongs.SelectedIndex];
}

private void axWindowsMediaPlayerMusic_Enter(object sender, EventArgs e)
{

}

private void pictureBox1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}