Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've implemented a custom UITypeEditor. The UITypeEditor is a modal dialog and should open as a child dialog of my application.
I've overriden the method EditValue, so i can show the dialog. The WindowsFormsEditorService handles the display of the dialog while in design time:

C#
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
    if (context != null && context.Instance != null && provider != null)
    {
        this.context = context;
        edSvc = (IWindowsFormsEditorService)provider.
                 GetService(typeof(IWindowsFormsEditorService));
        if (edSvc != null)
        {
            CollectionEditorForm editorFrm = new 
                                CollectionEditorForm(newCollection);
            edSvc.ShowDialog(editorFrm);
        }
    }
}



I've tried to set the Owner-property of the editor form, but hadn't any success yet.
How can i set the owner of my editor form?

Thanks in advance
Posted
Comments
TnTinMn 26-Nov-13 22:41pm    
I am not understanding what your goal is.

"The UITypeEditor is a modal dialog and should open as a child dialog of my application."

Do you mean that you what to display editorFrm while the application is running?
akamper 27-Nov-13 3:27am    
My project is a Dialog-Designer, like the one in VisualStudio.
The properties of the controls are configurable through a property grid.
Some of these properties are using an UITypeEditor for configuration and in some cases the UITypeEditor is a modal dialog (editorFrm).
The Dialog-Designer should be the owner of this modal dialog. At the moment my problem is that the modal dialog is opened at the wrong position.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900