Hello again
Make this variable a member of your Form class
private System.Media.SoundPlayer player;
Then in the constructor of the Form
public MyForm()
{
player = new System.Media.SoundPlayer();
}
Then in your button click code
private void MyAwsomeButton_click(object sender, EventArgs e)
{
player.Stream = Properties.Resources.cow;
player.Play();
}
private void trackBar1_Scroll(object sender, EventArgs e)
{
MySoundPlayer.Volume = trackBar1.Value;
player.Volume = trackBar1.Value;
}
Now the two are connected.
Can you spot the difference?
[UPDATE]
So the SoundPlayer doesn't have a volume property.
Well I kind of thought you had checked that, but OK here is some reading for you.
A Synchronized Volume Control for your Application[
^]
Controlling Sound Volume In C#[
^]
Good luck with your quest.