コード例 #1
0
        internal static FpField ShowAndRestore(string strTitle, string strText,
                                               List <FpField> lFields)
        {
            IntPtr h = IntPtr.Zero;

            try { h = NativeMethods.GetForegroundWindowHandle(); }
            catch (Exception) { Debug.Assert(false); }

            FieldPickerForm dlg = new FieldPickerForm();

            dlg.InitEx(strTitle, strText, lFields);

            FpField fpResult = null;

            if (UIUtil.ShowDialogAndDestroy(dlg) == DialogResult.OK)
            {
                fpResult = dlg.SelectedField;
            }

            try
            {
                if (h != IntPtr.Zero)
                {
                    NativeMethods.EnsureForegroundWindow(h);
                }
            }
            catch (Exception) { Debug.Assert(false); }

            return(fpResult);
        }
コード例 #2
0
		internal static FpField ShowAndRestore(string strTitle, string strText,
			List<FpField> lFields)
		{
			IntPtr h = IntPtr.Zero;
			try { h = NativeMethods.GetForegroundWindowHandle(); }
			catch(Exception) { Debug.Assert(false); }

			FieldPickerForm dlg = new FieldPickerForm();
			dlg.InitEx(strTitle, strText, lFields);

			FpField fpResult = null;
			if(UIUtil.ShowDialogAndDestroy(dlg) == DialogResult.OK)
				fpResult = dlg.SelectedField;

			try
			{
				if(h != IntPtr.Zero)
					NativeMethods.EnsureForegroundWindow(h);
			}
			catch(Exception) { Debug.Assert(false); }

			return fpResult;
		}