private void SearchForCulture() { var culture = FormDialogFindSelectCulture.ShowDialog(this); if (culture != null) { cmbLocale.SelectedItem = culture; } }
/// <summary> /// Shows the form as a modal dialog box with the specified owner. /// </summary> /// <param name="owner">>Any object that implements <see cref="T:System.Windows.Forms.IWin32Window" /> that represents the top-level window that will own the modal dialog box.</param> /// <returns>A user selected <see cref="CultureInfo"/> culture if the dialog was accepted; otherwise null.</returns> public new static CultureInfo ShowDialog(IWin32Window owner) { using (var form = new FormDialogFindSelectCulture()) { if (((Form)form).ShowDialog(owner) == DialogResult.OK) { return(form.lbCultures.SelectedItem as CultureInfo); } } return(null); }