/// <summary> /// Enable or disable the CreateInstallerButton in a thread-safe way. /// </summary> /// <param name="enable">true to enable the button, false to disable it.</param> private void ThreadSafeEnableControls(bool enable) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (ComponentSummaryText.InvokeRequired) { var d = new SetTextCallbackWithBool(ThreadSafeEnableControls); ComponentSummaryText.Invoke(d, new object[] { enable }); } else { CreateInstallerButton.Enabled = enable; ComponentNamesBox.Enabled = enable; } }