private void OK_Button_Click(object sender, EventArgs e) { if (this.ListsList.SelectedIndex > -1) { _selectedList = (ListElement)this.ListsList.SelectedItem; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } }