C# Kodları:
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 WindowsFormsApplication20
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
for(int i = 0; i < openFileDialog1.SafeFileNames.Length; i++)
{
listBox1.Items.Add(openFileDialog1.SafeFileNames[i].ToString());
listBox2.Items.Add(openFileDialog1.FileNames[i].ToString());
}
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
listBox2.SelectedIndex = listBox1.SelectedIndex;
axWindowsMediaPlayer1.URL = listBox2.SelectedItem.ToString();
axWindowsMediaPlayer1.Ctlcontrols.play();
}
private void button2_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.pause();
}
private void button3_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.play();
}
private void button5_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.settings.volume += 10;
}
private void button6_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.settings.volume -= 10;
}
private void trackBar1_ValueChanged(object sender, EventArgs e)
{
axWindowsMediaPlayer1.settings.volume = trackBar1.Value;
}
private void button8_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.fastForward();
}
private void button7_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.fastReverse();
}
private void button9_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
listBox2.Items.Clear();
axWindowsMediaPlayer1.Ctlcontrols.stop();
}
private void Form1_Load(object sender, EventArgs e)
{
this.BackgroundImage = Image.FromFile("img/bg.jpg");
button2.BackgroundImage = Image.FromFile("img/pause.png");
button3.BackgroundImage = Image.FromFile("img/play.png");
button7.BackgroundImage = Image.FromFile("img/back.png");
button8.BackgroundImage = Image.FromFile("img/next.png");
button1.BackgroundImage = Image.FromFile("img/music.png");
button9.BackgroundImage = Image.FromFile("img/delete.png");
}
}
}
Hiç yorum yok :
Yorum Gönder