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
  1. Home
  2. General Programming
  3. Visual Basic
  4. MDI skinning question

MDI skinning question

Scheduled Pinned Locked Moved Visual Basic
graphicsquestion
3 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.
  • E Offline
    E Offline
    Enriad
    wrote on last edited by
    #1

    Hey guys, I've tried looking everywhere and I can't seem to find a solution. Basically, I want to change the inside "box" of an MDI parent form (where an MDIChild can go) and round the corners there. I tried drawing a "border" around the MDIChild and forms, I also thought I could set the background colour to transparent of the MDI Parent, though this didn't work. If someone could point me in the right direction or let me know it cannot be done, that would be great. Thanks, Daniel

    M 1 Reply Last reply
    0
    • E Enriad

      Hey guys, I've tried looking everywhere and I can't seem to find a solution. Basically, I want to change the inside "box" of an MDI parent form (where an MDIChild can go) and round the corners there. I tried drawing a "border" around the MDIChild and forms, I also thought I could set the background colour to transparent of the MDI Parent, though this didn't work. If someone could point me in the right direction or let me know it cannot be done, that would be great. Thanks, Daniel

      M Offline
      M Offline
      Martin Smith
      wrote on last edited by
      #2

      Hi Daniel, I'm not sure it is possible to achieve what it is you are trying do, but I do have a bit of past experience with MDI forms. I originally wrote an application where I wanted to change the backround image of the MDI form. This is not possible by setting the forms "BackgroundImage" property. I found that the MDI form has a control on it that handles all the displaying of child forms. It is this control that I had to alter the background image property of. Below is a snippet of code I used to achieve this, perhaps you can manipulate the MDI form control in a similar fashion to what I did to achieve your rounded corners:

          For Each Mdi\_display As Control In Me.Controls
              If TypeOf (Mdi\_display) Is MdiClient Then
                  ' Set colour to white
                  Mdi\_display.BackColor = Color.White
      
                  ' Centre the image
                  Mdi\_display.BackgroundImageLayout = ImageLayout.Center
      
                  ' Set background image
                  Mdi\_display.BackgroundImage = My.Resources.Main\_background
      
                  Mdi\_display.Refresh()
      
                  ' All done!
                  Exit For
              End If
          Next
      

      Regards,

      Martin

      E 1 Reply Last reply
      0
      • M Martin Smith

        Hi Daniel, I'm not sure it is possible to achieve what it is you are trying do, but I do have a bit of past experience with MDI forms. I originally wrote an application where I wanted to change the backround image of the MDI form. This is not possible by setting the forms "BackgroundImage" property. I found that the MDI form has a control on it that handles all the displaying of child forms. It is this control that I had to alter the background image property of. Below is a snippet of code I used to achieve this, perhaps you can manipulate the MDI form control in a similar fashion to what I did to achieve your rounded corners:

            For Each Mdi\_display As Control In Me.Controls
                If TypeOf (Mdi\_display) Is MdiClient Then
                    ' Set colour to white
                    Mdi\_display.BackColor = Color.White
        
                    ' Centre the image
                    Mdi\_display.BackgroundImageLayout = ImageLayout.Center
        
                    ' Set background image
                    Mdi\_display.BackgroundImage = My.Resources.Main\_background
        
                    Mdi\_display.Refresh()
        
                    ' All done!
                    Exit For
                End If
            Next
        

        Regards,

        Martin

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

        Hi Martin, thanks for that. Works great for a background image (which I might add in later, looks better than the grey and much nicer than doing it the way I was fiddling with before). Unfortunately, the client area still has a square border around it :/

        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