private void enableVoting() { // 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 (this.startVoteButton.InvokeRequired || this.seeResultsButton.InvokeRequired) { EnableVotingCallback d = new EnableVotingCallback(enableVoting); this.Invoke(d); } else { this.startVoteButton.Enabled = true; this.seeResultsButton.Enabled = true; } }