public void ExecuteTask(Action action) { //fw = new FormWaitMarquee(this); f.ShowForm(); cancelableThread = new Thread(() => { action(); CloseForm(); }); cancelableThread.Start(); }