private void btnSelect_Click(object sender, System.EventArgs e) { //set the dialog results to OK this.DialogResult = DialogResult.OK; //select all the weather items with are selected in the listbox SelectWeatherItems(); }