src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/DropDownControl.cs
/// <summary>
///     Show the type editor dialog. Implements IWindowsFormsEditorService.ShowDialog.
/// </summary>
/// <param name="dialog"></param>
/// <returns></returns>
Show the type editor dialog.
Show the type editor dialog .
protected DialogResult ShowDialog(Form dialog)
        {
            _dialogResult = DialogResult.None;
            if (dialog.StartPosition == FormStartPosition.CenterScreen)
            {
                Control topControl = this;
                if (topControl != null)
                {
                    while (topControl.Parent != null)
                    {
                        topControl = topControl.Parent;
                    }
                    if (topControl.Size.Equals(dialog.Size))
                    {
                        dialog.StartPosition = FormStartPosition.Manual;
                        var location = topControl.Location;
                        location.Offset(25, 25);
                        dialog.Location = location;
                    }
                }
            }
            var service = (IUIService)((IServiceProvider)this).GetService(typeof(IUIService));
            try
            {
                _inShowDialog = true;
                if (service != null)
                {
                    _dialogResult = service.ShowDialog(dialog);
                }
                else
                {
                    _dialogResult = dialog.ShowDialog(this);
                }
            }
            finally
            {
                _inShowDialog = false;
            }
            if (_edit != null)
            {
                _edit.Focus();
            }
            else
            {
                Focus();
            }
            return _dialogResult;
        }
protected DialogResult ShowDialog ( Form dialog ) { _dialogResult = DialogResult . None ; if ( dialog . StartPosition == FormStartPosition . CenterScreen ) { Control topControl = this ; if ( topControl != null ) { while ( topControl . Parent != null ) { topControl = topControl . Parent ; } if ( topControl . Size . Equals ( dialog . Size ) ) { dialog . StartPosition = FormStartPosition . Manual ; var location = topControl . Location ; location . Offset ( 25 , 25 ) ; dialog . Location = location ; } } } var service = ( IUIService ) ( ( IServiceProvider ) this ) . GetService ( typeof ( IUIService ) ) ; try { _inShowDialog = true ; if ( service != null ) { _dialogResult = service . ShowDialog ( dialog ) ; } else { _dialogResult = dialog . ShowDialog ( this ) ; } } finally { _inShowDialog = false ; } if ( _edit != null ) { _edit . Focus ( ) ; } else { Focus ( ) ; } return _dialogResult ; }
Show the type editor dialog.
Show the type editor dialog .
// try to shift down if sitting right on top of existing owner. // CONSIDER what constant to get here? // give focus back to the text box
None
dialog
Form
None