isLooping = false;//on mouse downprivate void myControl_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { isLooping = true; runLoop();}//on mouse up eventprivate void myControl_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { isLooping = false;}//This is the main loop you care about. Put this in your application//This should go in its own threadvoid runLoop() { while (isLooping) { //do stuff }}