I'v put in a Media Player that i made into my current project and working on using the System.Threading;
My First time really applying the Threading so i need some help with assigning a toolStripButton for the MediaPlayer using Threading and BackgroundWorker this is what i have so far..
So any help with this is greatly appreciated i always give out Reputation Points, My 1st time using Threading and BackgroundWorkerCode:using System; using System.Threading; using System.Runtime; // didnt put in all the Using.. namespace MediaViewer { using WMPLib; using MediaPlayer; public partial class Form1 : Form { private Thread MediaThread = null; private BackgroundWorker BackgroundWorker1; { public Form1() { InitializeComponent(); } private toolStripButton2_Click(object sender, EventArgs e) { MediaThread = new Thread(new ThreadStart(this.RunMethod)); if (sender == toolStripButton2) { Application.Exit(); if (MediaThread.IsAlive) MediaThread.Abort(); if (Thread.CurrentThread.IsAlive) Thread.CurrentThread.Abort(); } } private void RunMethod { Thread.CurrentThread.IsBackground.GetType(); MediaThread.Start() // this is where i want too MediaPlayer to run using the toolStripButton2_Click while using the Thread & BackgroundWorker }





Reply With Quote