Results 1 to 3 of 3

Thread: How to reslove it?

  1. #1

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    How to reslove it?

    There is one function which is listening.
    I want it to be run continuously and rest of the program should also be fully operatable.
    How can i do it?

  2. #2
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: How to reslove it?

    you can make it call itself and run it on a seperate thread.
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

  3. #3
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: How to reslove it?

    this code keeps checking if a checkbox is checked and terminates the thread if it isn't.
    Code:
    	private void button1_Click(object sender, System.EventArgs e)
    		{
    			System.Diagnostics.Debug.WriteLine("startthread");
    			Thread t = new Thread(new ThreadStart(threader));
    			t.Start();
    		}
    
    		private void threader()
    		{
    			Thread.Sleep(100);
    			if (this.checkBox1.Checked)
    			{
    
    				threader();
    			}
    			else
    			{
    				System.Diagnostics.Debug.WriteLine("stop");
    			}
    		}
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

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