Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_Show_Window

Does the AdjustMDIClient or Adjust property allow MDI child windows under Windows 10 to show the Windows 10 theme?
«1

Comments

  • No. Windows 10 controls how those look entirely. For whatever reason, Windows 10 decided not to theme MDI children. I think it's because MDI is now considered passe.
  • I thought that was the case, Oh well. One of these days I need to remove the mdi child windows.
  • @jimvaughan remove midi childs and replace with what?
  • Use Start_Window instead of Start_MDI_Child.
  • Are your current MDI Child forms reliant upon the MDI Frame for menus, toolbar buttons, or any other parent feature?
  • Somewhat, that is why I have not yet made the change. I think it will be a fair amount of work.
  • Going back to your original question, what kind of Windows 10 theme were you looking to create in your MDI Child windows? Are you just thinking about the borders?


  • I want the window underneath to look like the one on top.
  • Okay. This is what was thinking (i.e., the borders). This has been a longstanding gripe of mine as well. I think the theme issue predates Windows 10. AFAIK, Windows 7 themed the borders of MDI Children differently from the MDI Frame (or other top-level forms).

    As Kevin noted, MDI is considered passe but I don't think this has given way to pure SDI either. Productivity applications seem to favor a hybrid approach. Look at your browser or most IDEs: they are tabbed UIs. Each tab corresponds to a document (hence a quasi-MDI app). You can achieve something similar by maximizing your MDI Children and using a tab or vertical menu UI to navigate (the SRP Editor is a good example of this).

    We've also built an application that makes use of the SRP Panel control to achieve even more impressive results. Instead of multiple MDI Children we just have one master MDI Child with SRP Panel controls. Then each SRP Panel control is loaded with a form. Here's an example of what this looks like:


  • That looks really good. Is it an extra control or does it come with what I already have?
  • You have everything you need. In the above example, here are the controls being used:
    • SRP Tree control (for the vertical menu on the MDI Frame and the hierarchical tree in Form 1)
    • SRP Panel control
    • SRP Splitter control
    • SRP Button control (for the MDI Frame toolbar and the buttons on Form 4)
    • SRP Preview control (for the PDF/file preview on Form 3)
    • SRP Subclass control (for the edit line prompts and the edit line dropdown combos on Form 1 and Form 4, and for the edit line option button on Form 2)
    • SRP StatusBar (for the statusbar on the MDI Frame)
  • I know now why MDI borders behave this way. Even though Windows 10 borders seem simpler, they are technically more complicated due to the drop shadows. This is done by compositing the window with the rest of the desktop. That same compositing cannot be done when windows are children of other windows. Since MDI is deprecated, Microsoft didn't bother changing it. Note that, if you force MS Office into MDI mode, you get the same effect.

    I am in the process of seeing if I can custom draw the MDI child frames. While I'm at it, I'll support custom drawing of the MDI client as well.
  • Kevin,
    Interesting, very interesting. Let me know how this goes.
  • Don,
    I didn't even now the panel control existed. Thank you for all the information.
  • Jim - Yes, informing our customers of everything in our catalog is a common problem I would like to resolve. Perhaps a blog series that reviews each control in our Pro catalog would be a good idea. I want our customers to get maximum value out of our products. In the meantime, make sure you visit our Products site and then hover over the Controls menu. Pro customers have everything listed.
  • SRP Preview control (for the PDF/file preview on Form 3)



  • I have never heard of the SRP preview control? I had the need to display a pdf in an oi form, and i thought of using the embedded IE web browser, but the srp preview control sounds better. It doesn't seem to be documented.
  • We haven't made a big announcement for the control because it's really just the same preview that's in Windows Explorer. The downside is that there is no control over what it will and won't preview and how it displays it. It depends what Windows supports out of the box (which differs from OS to OS) and what 3rd party programs add support. Thus, we didn't want to get bogged down in supporting something with so much potential variance.

    Here's all the info you need to use it, but I will start with the disclaimer that if something won't show up in the preview or doesn't display the way you want, there's nothing we can do about it.

    ProgID: SRP.Preview.1

    OLE.Background - Property to set the background color, just like other Background properties we support.
    OLE.Border - Property to set the border style, just like other Border properties we support.
    OLE.Font - Property to set the caption font, just like other Font properties we support.
    OLE.Caption - Property to set the text caption of the Preview control when there is no document being previewed. Similar to the Picture control's Caption property.
    OLE.Preview(Filename)- Method to tell the Preview control to preview a document. Pass in the path (relative or absolute) to a file.
    OLE.Clear() - Method to clear the Preview control of any documents.
  • I totally forgot that this control was undocumented, primarily for the reasons Kevin cited.
    ...we didn't want to get bogged down in supporting something with so much potential variance.

    ...I will start with the disclaimer that if something won't show up in the preview or doesn't display the way you want, there's nothing we can do about it.

    I want to repeat the above comments. If it works for you then great, we are very happy that another feature of our toolset is making a difference. If it doesn't work, then we regret this fact but we'll have to politely decline or deescalate the priority of seeing if there is anything we can do about it.
  • Fair enough. I was thinking hoping you had found a way around those issues we've also experienced.
    It seems you have not.
    Actually kind of glad for this conversation just to know I'm not the only one experiencing those inconsistencies.
  • @AusMarkB - Remind me, which inconsistencies are you referring to?
  • You mean in case we're talking different things?
    Why certainly.

    For displaying pdfs, I use to use an ole control with an id of Acropdf or something along those lines and then do a send_message LoadImage or again, something like that. Memory is a bit rusty on it. I thought this worked quite well until at some point I rolled out a similar feature to another client and whilst it continued to work nicely on my laptop, too many of their users had no such luck. For many, just nothing would happen. I couldn't find a reliable way to get consistent results.

    I changed to a browser type control and started loading them that way. This was a little more reliable but again inconsistent. For some like myself it would display the pdfs straight in the window, for others it would launch their default browser outside of OI and for others it would popup a message which whilst I can't remember exactly what it said, it was cryptic to users especially when the pdf was being loaded as a convenience and not their point of focus.

    It was clearly a case of one size does not fit all and it's out of my realm to go from machine to machine to machine to try and fix it.
  • I see. I thought you were referring to the behavior of something we've delivered. You were comparing our comments about the SRP Preview control with your experiences with using other (albeit similar) solutions.
  • That I was. I was hoping you had a new control that solved my displaying pdfs issues.

    I see now though, why you asked for clarification.
  • @jimvaughan, I've created a new SRPControls.ocx build for you to try out. It's version number is 4.1.6 RC4. It adds support for theming the MDI child windows.

    To make it work, put a Subclass control on your frame window. Then subclass the MDICLIENT control like so:

    Handle = Get_Property(@Window:".MDICLIENT", "HANDLE") Send_Message(@Window:".OLE_SUBCLASS", "OLE.Subclass", Handle, @Window:".MDICLIENT")

    Make sure to subclass the MDICLIENT before starting any MDI child windows.

    If you are using the SRP Ribbon Control, then you don't have to do anything else. The subclass control will apply the Ribbon's theme to the MDI children. If you are not using the SRP Ribbon Control, then you can set the theme like so:

    Set_Property(@Window:".OLE_SUBCLASS", "OLE.MdiTheme[":@Window:";MDICLIENT]", "Windows10")

    This version adds a theme called "Windows10" which mimics the look you are after, but it is not dynamic. It is only the white Windows 10 theme.

    Consider this a beta release. Let me know if you have any questions or run into any problems.

    BONUS FEATURE: when you subclass the MDICLIENT, then the double-click bug reported in your other thread goes away.
  • Kevin,
    Wow, what a fantastic way to start the day. Thank you very very much. I owe you a few beers at the next conference.
  • Sure thing, but make sure it works as expected first. :)
  • ...at the next conference.

    What is that? I have a vague and distant memory of that word...
  • I'll test this morning.

    Don, I wonder how long it will before the next one?
  • Kevin,

    It works. That looks so much better. Three lines of code. Brilliant.
Sign In or Register to comment.