Results 1 to 5 of 5

Thread: Threading issue Help Please

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Rattlerr's Avatar
    Join Date
    Jul 2005
    Location
    FloralCity,Florida
    Posts
    269

    Question Threading issue Help Please

    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..

    Code:
     
    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
    }
    So any help with this is greatly appreciated i always give out Reputation Points, My 1st time using Threading and BackgroundWorker
    Last edited by Rattlerr; Mar 2nd, 2006 at 04:59 PM. Reason: New Code Insertion

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width