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. C#
  4. Background image in MDI container

Background image in MDI container

Scheduled Pinned Locked Moved C#
dockerquestion
4 Posts 4 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.
  • M Offline
    M Offline
    MJay
    wrote on last edited by
    #1

    i have a MainForm that act as a MDI container, i load the company logo as backgroundimage, but the image is load as tile mode which fill all the MDI container, is there anyway to set the background image to the center of the MDI container instead of tile?

    R S 2 Replies Last reply
    0
    • M MJay

      i have a MainForm that act as a MDI container, i load the company logo as backgroundimage, but the image is load as tile mode which fill all the MDI container, is there anyway to set the background image to the center of the MDI container instead of tile?

      R Offline
      R Offline
      Rizwan Bashir
      wrote on last edited by
      #2

      the way out is little tricky... Add another form in your application. Add picture box on it. Assign image in it. then come to your main MDI Form. and in class Declaration inherit it with this new form. and your job is done.. hope this helps

      A 1 Reply Last reply
      0
      • R Rizwan Bashir

        the way out is little tricky... Add another form in your application. Add picture box on it. Assign image in it. then come to your main MDI Form. and in class Declaration inherit it with this new form. and your job is done.. hope this helps

        A Offline
        A Offline
        Alomgir Miah
        wrote on last edited by
        #3

        There is one more trick, Form f = new Form(); Panel p = new Panel() f.Controls.Add(p); p.Dock = DockStyle.Fill; p.BackGroundImage = //your image p.BackgroundImageLayout = ImageLayout.Center; This will work only in VS.NET 2005. Thanks, Alomgir

        1 Reply Last reply
        0
        • M MJay

          i have a MainForm that act as a MDI container, i load the company logo as backgroundimage, but the image is load as tile mode which fill all the MDI container, is there anyway to set the background image to the center of the MDI container instead of tile?

          S Offline
          S Offline
          Skynyrd
          wrote on last edited by
          #4

          U could, handling the paint events of the MdiClient control. But isnt easier to just use the designer to drop a picturebox with the logo where u want it instead of using background images? Maybe I misunderstood ur question.

          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