Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Transparent Mdi

Transparent Mdi

Scheduled Pinned Locked Moved Visual Basic
helpdesigndocker
8 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    errorfunktion
    wrote on last edited by
    #1

    Hi, I want to design an Mdi application but with a transparent background for the MdiClient container (and form). It should behave in a similar fashion to the way "Mathematica" behaves if you know that software. I have two screens. I want various child forms to be scattered across both screens but at the same time windows from a different application must be visible, and respond to mouse events, in screen areas where there are no child forms. Put it another way the MdiClient container must fill both screens but be transparent. The problem is that the class MdiClient in non inheritable and I can not override the appropriate method to not color the background. Setting transparentkey in the main form to some color and setting the MdiClient background to this color doesn't work either, the MdiClient control doesn't support transparent background colors. If you have a different idea how I can achieve this functionality that's fine by me. My desire is simply to able to use my screens working area with maximum efficiency and at the same time have the sub forms behave as child forms of a single application. Any help will be most appreciated, Gary

    T 1 Reply Last reply
    0
    • E errorfunktion

      Hi, I want to design an Mdi application but with a transparent background for the MdiClient container (and form). It should behave in a similar fashion to the way "Mathematica" behaves if you know that software. I have two screens. I want various child forms to be scattered across both screens but at the same time windows from a different application must be visible, and respond to mouse events, in screen areas where there are no child forms. Put it another way the MdiClient container must fill both screens but be transparent. The problem is that the class MdiClient in non inheritable and I can not override the appropriate method to not color the background. Setting transparentkey in the main form to some color and setting the MdiClient background to this color doesn't work either, the MdiClient control doesn't support transparent background colors. If you have a different idea how I can achieve this functionality that's fine by me. My desire is simply to able to use my screens working area with maximum efficiency and at the same time have the sub forms behave as child forms of a single application. Any help will be most appreciated, Gary

      T Offline
      T Offline
      Tom Deketelaere
      wrote on last edited by
      #2

      I'm not sure but I think the mdiform overrides his color property and sets it back to the default color. I veagly remember trying something like this a few years ago and if I remember correctly I was able to change the color in code. So perhaps you need to set the transparenty color and color of the mdiclient container in code

      E 1 Reply Last reply
      0
      • T Tom Deketelaere

        I'm not sure but I think the mdiform overrides his color property and sets it back to the default color. I veagly remember trying something like this a few years ago and if I remember correctly I was able to change the color in code. So perhaps you need to set the transparenty color and color of the mdiclient container in code

        E Offline
        E Offline
        errorfunktion
        wrote on last edited by
        #3

        Nah, using this line of code: mdiclient1.BackColor = Color.Transparent Generates the following exception: "Control does not support transparent background colors" But it works fine for any other color.

        T D 2 Replies Last reply
        0
        • E errorfunktion

          Nah, using this line of code: mdiclient1.BackColor = Color.Transparent Generates the following exception: "Control does not support transparent background colors" But it works fine for any other color.

          T Offline
          T Offline
          Tom Deketelaere
          wrote on last edited by
          #4

          then try the following mdiclient1.transparencykey = color.white mdiclient1.backcolor = color.white I'm not sure what will happen. I think you mdi container will just disapear unless there is a form in it which doesn't have its backcolor set to white (once again it's been a few years since I experimented with it so it's a bit vage)

          1 Reply Last reply
          0
          • E errorfunktion

            Nah, using this line of code: mdiclient1.BackColor = Color.Transparent Generates the following exception: "Control does not support transparent background colors" But it works fine for any other color.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            You can't do what you want. The MdiClient container does not support a Transparent background, nor does the form hosting it. It can probably be done. You'll have to create your own Form class to support this stuff, complete with how to setup your own window and custom drawing code to show it. You'd better have a thorough knowledge of how Window's windows work, especially Layered Windows. And you'll have to do a bunch of trial-and-error work to get it correct. You're treading in undocumented territory, so you won't be getting much, if any, help on exactly how to pull this off. I hope you can do your own research.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            E 1 Reply Last reply
            0
            • D Dave Kreskowiak

              You can't do what you want. The MdiClient container does not support a Transparent background, nor does the form hosting it. It can probably be done. You'll have to create your own Form class to support this stuff, complete with how to setup your own window and custom drawing code to show it. You'd better have a thorough knowledge of how Window's windows work, especially Layered Windows. And you'll have to do a bunch of trial-and-error work to get it correct. You're treading in undocumented territory, so you won't be getting much, if any, help on exactly how to pull this off. I hope you can do your own research.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007

              E Offline
              E Offline
              errorfunktion
              wrote on last edited by
              #6

              Well, I know for sure it has been done. I got the inspiration for this from "Mathematica". But no, there's no way I can pull this off myself, I don't have the knowledge. I will find a way to work around this. Thanks

              D 1 Reply Last reply
              0
              • E errorfunktion

                Well, I know for sure it has been done. I got the inspiration for this from "Mathematica". But no, there's no way I can pull this off myself, I don't have the knowledge. I will find a way to work around this. Thanks

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Mathematica doesn't use Windows Forms. It uses custom coded windows that do NOT have the weight of the .NET Framework Form class on top of it. It's kind of like making your own chocalate chip cookies from scratch. You know, grinding the flour yourself, making the chocolate chips, raising chickens to lay the eggs you need, ... And then there's the .NET Framework Form class, where you just pull a ready-made cookie out of a bag.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007

                E 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Mathematica doesn't use Windows Forms. It uses custom coded windows that do NOT have the weight of the .NET Framework Form class on top of it. It's kind of like making your own chocalate chip cookies from scratch. You know, grinding the flour yourself, making the chocolate chips, raising chickens to lay the eggs you need, ... And then there's the .NET Framework Form class, where you just pull a ready-made cookie out of a bag.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007

                  E Offline
                  E Offline
                  errorfunktion
                  wrote on last edited by
                  #8

                  I know. Kudos on the cookie analogy.;)

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups