private void DoitButton_Click(object sender, EventArgs e) { if (_suggestions.Length > 0) { Suggestion suggestion = GetCurrentSuggestion(); WindowState = FormWindowState.Minimized; _parent.LastAcceptedSuggestion = suggestion; ThreadStart ts = new ThreadStart(delegate() { suggestion.Execute(GetCurrentSpeed(), GetCurrentIgnoreSpeed()); }); _thread = new Thread(ts); _thread.SetApartmentState(ApartmentState.STA); _thread.Start(); _thread.Join(); Close(); } }