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. MDI Parent Picturebox control always stays on top of child forms..... NEED HELP!!!!

MDI Parent Picturebox control always stays on top of child forms..... NEED HELP!!!!

Scheduled Pinned Locked Moved Visual Basic
questionalgorithmshelptutorial
4 Posts 2 Posters 0 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.
  • J Offline
    J Offline
    Joey Picerno
    wrote on last edited by
    #1

    Ok I have a picturebox being centered on my MDI Parent form. WHenever I open a child form of my MDI parent form the picturebox floats in front of the child form. I know that this is how MDI Parent forms are supposed to act. I have found that any control placed on an MDI parent form will always be in front of any child forms. I already have a background image property set but need another image centered in the middle. I have the code for centering but need to figure out how to get this picbox to stay in the background. Since I already have a background image set this is not going to be the solution which seems to be the answer everyone gives for this question as I have found through searching the web. Does anyone know a way to keep a picturebox (or any control for that matter) on an MDI parent form in the background when child forms are opened??? if you can solve this I will be in debt to you forever! PLEASE SOMEBODY HELP ME!!!!!

    D 1 Reply Last reply
    0
    • J Joey Picerno

      Ok I have a picturebox being centered on my MDI Parent form. WHenever I open a child form of my MDI parent form the picturebox floats in front of the child form. I know that this is how MDI Parent forms are supposed to act. I have found that any control placed on an MDI parent form will always be in front of any child forms. I already have a background image property set but need another image centered in the middle. I have the code for centering but need to figure out how to get this picbox to stay in the background. Since I already have a background image set this is not going to be the solution which seems to be the answer everyone gives for this question as I have found through searching the web. Does anyone know a way to keep a picturebox (or any control for that matter) on an MDI parent form in the background when child forms are opened??? if you can solve this I will be in debt to you forever! PLEASE SOMEBODY HELP ME!!!!!

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

      This is the expected behavior. The MDI Parent has a control on it, called the MDIClient, that sits behind all other controls on the form. All MDI Child windows are rendered by the MDIClient control. Any controls you put on the MDI Parent form will sits "in front of" the MDIClient control. It's possible to bring the MDIClient control to the front, but when you do this, it will cover the PictureBox control. You won't be able to see the picture you put in there. The MDIClient control does have a BackgroundImage property, so you can setup a picture on it. You can find out how to get a handle on the MDIClient control here[^].

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

      J 1 Reply Last reply
      0
      • D Dave Kreskowiak

        This is the expected behavior. The MDI Parent has a control on it, called the MDIClient, that sits behind all other controls on the form. All MDI Child windows are rendered by the MDIClient control. Any controls you put on the MDI Parent form will sits "in front of" the MDIClient control. It's possible to bring the MDIClient control to the front, but when you do this, it will cover the PictureBox control. You won't be able to see the picture you put in there. The MDIClient control does have a BackgroundImage property, so you can setup a picture on it. You can find out how to get a handle on the MDIClient control here[^].

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

        J Offline
        J Offline
        Joey Picerno
        wrote on last edited by
        #3

        Yes I even put in my message that I found out that this was the expected behavior. I also put that I already have a background image so I cant use that as a solution to my problem. I need a "workaround" for this. I take it there is no way you can think of to accomplish what I need to do??? Thank you for replying to my question tho. Im not trying to down your post or anything, it just didnt give me any information I didnt already know. There has got to be a way to accomplish what I am trying to do. I am not advanced enough to figure it out tho. I am still pretty much a begginer at programming. I guess you could call me an "advanced-beginner". Not quite to the novice class yet... So please, all advanced programmers: HELP ME!!!!!

        D 1 Reply Last reply
        0
        • J Joey Picerno

          Yes I even put in my message that I found out that this was the expected behavior. I also put that I already have a background image so I cant use that as a solution to my problem. I need a "workaround" for this. I take it there is no way you can think of to accomplish what I need to do??? Thank you for replying to my question tho. Im not trying to down your post or anything, it just didnt give me any information I didnt already know. There has got to be a way to accomplish what I am trying to do. I am not advanced enough to figure it out tho. I am still pretty much a begginer at programming. I guess you could call me an "advanced-beginner". Not quite to the novice class yet... So please, all advanced programmers: HELP ME!!!!!

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

          I'm not entirely sure what you're trying to do. That's why you got the description you did. But, if you're trying to show two images as the background of the MDIClient area, you need to combine them as a single bitmap and set the BackgroundImage of the MDIClient to that new image. There is no other alternative.

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

          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