Tech Off Post

Single Post Permalink

View Thread: Add form in another appdomain to mdi container
  • User profile image

    So I've been playing around with it a little...and I found setting the form's parent to the MdiClient's handle makes it a little less buggy.
    SetParent(formHandle, MdiClient.Handle);

    #3 seems to no longer be a problem

    The maximize issue stated in #2 is somewhat remedied. When you maximize a plugin form it no longer maximizes over the menubar and toolbar but rather under it. Usually the behavior when you maximize a window is that the window's title is appended to the mdi parent's title. This does not happen when you maximize plugin forms.

    #1 is still an issue. For some reason, the title bars always appear inactive even if they are the front-most form.

    I've also noticed that tabbing to the next control doesn't work in plugin windows. Also control-tab to flip between windows is a little buggy.

    There's two approaches I can think of that may fix this. I could create my own MdiClient class so that it accounts for showing child windows via an instance of Form or a handle.

    Another idea, and this seems like it's kind of a hack, is to:
    1. Create a Form for each plugin
    2. Copy the form style, title, and icon of the plugin window to the Form I newed up
    3. Remove the style from the plugin window
    4. Embed the plugin window's contents in the Form