private void btnSpltData_Click(object sender, RibbonControlEventArgs e) { FieldSelector fs = new FieldSelector(); fs.ShowDialog(); if (fs.DialogResult == DialogResult.OK) // Did user press the 'done' button? or did they exit using X { foreach (var checkedField in fs.CheckedFields) { // do stuff with the value } } }