Witam,
Mam problem z pewnym fantem w c#. W załączniku jest pokazany błąd. Dużo szukałem ale nie mogłem znaleźć rozwiązania. Jak rozwiązać ten problem?
A tutaj jest cały kod:
using System;
using System.Windows.Forms;
using System.Media;
using System.Diagnostics;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
namespace Dzwiek
{
public partial class Form1 : Form
{
SoundEffect ms;
ContentManager Content ;
public Form1()
{
InitializeComponent();
}
Stopwatch sw = new Stopwatch();
private void button1_Click(object sender, EventArgs e)
{
if (timer1.Enabled == false)
{
timer1.Enabled = true;
}
else
{
timer1.Enabled = false;
};
sw.Start();
}
void metoda()
{
//SystemSounds.Beep.Play();
ms = Content.Load<SoundEffect>("AA.wav");
ms.Play();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (sw.ElapsedMilliseconds >= 200)
{
metoda();
sw.Restart();
}
}
}
}