public partial class MainWindow : Window { System.Timers.Timer t=new System.Timers.Timer(); t.Interval=5000; public MainWindow() { this.InitializeComponent(); // Insert code required on object creation below this point. } private void Button1_Click(object sender, System.Windows.RoutedEventArgs e) { this.media1.Play(); //mel_Copy.Stop(); t.Enabled=true; t.Tick+=new System.EventHandle(this.timer1_Tick); //here //B1 } private void timer1_Tick(object sender, System.EventArgs e) { this.media1.Stop(); } } }
DispatcherTimer
System.Timers.Timer
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)