private void GetResults_Click(object sender, EventArgs e) { string Error; Error = CheckResults(); if (Error == "") { if (LHC is null) { LHC = new LeyHontCalculator(seats, threshold, census, blanks, invalid); foreach (PoliticalPartieVisualComponent p in PoliticalParties.Where(p => p.Initialized == true)) { LHC.AddPoliticalParty(p._PartiName(), p._NumberOfVotes()); } LHC.PartiesHaveBeenAdded(); LHC.GetResults(); form2 = new Form2(LHC); } // Show the result after having done the calculations. if (form2 is null) { form2 = new Form2(LHC); } form2.Show(); } else { MessageBox.Show(Error); } }