private void btnOK_Click(object sender, EventArgs e) { CheckedElements.Clear(); for (int ii = 0; ii < SystemCheckList.Items.Count; ++ii) { if (SystemCheckList.GetItemChecked(ii)) { CheckedElements.Insert(allElementItems[ii]); } } if (CheckedElements.Size == 0) { //UIHelperFunctions.postWarning(ReportResource.invalidSystemMsg, ReportResource.selectSystemsMsg); this.DialogResult = DialogResult.None; } else { this.DialogResult = DialogResult.OK; } }