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. NEED HELP PLEASE!!!!!!

NEED HELP PLEASE!!!!!!

Scheduled Pinned Locked Moved Visual Basic
graphicshelp
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

    I have an MDI application with the option of changing the background. Some of the child forms open maximized and I want them to have the same background as the MDI parent. This is what I have: If frmMainMDI.BackgroundImage = My.Resources.TurquoiseBack Then Form.ActiveForm.ActiveMdiChild.BackgroundImage = My.Resources.TurquoiseBack And so on and so on for each background the user can choose from.... This code is in a setbackground() sub in a global module. Each time one of these maximized child forms open I run the Setbackground sub. on the " frmMainMDI.BackgroundImage = My.Resources.TurquoiseBack " I get a squiggly and it says that operator " = " is not defined for system.drawing.image and system.drawing.bitmap. The wierd thing is that if I type this same thing in after my "then" of the if statement I do not get the squiggly... This is kind of hard to explain because there is alot more to the way I am trying to accomplish this but this is just the part that is confusing me. Please, anyone that knows why I am getting this, please help me. Thank you!!!

    D 1 Reply Last reply
    0
    • J Joey Picerno

      I have an MDI application with the option of changing the background. Some of the child forms open maximized and I want them to have the same background as the MDI parent. This is what I have: If frmMainMDI.BackgroundImage = My.Resources.TurquoiseBack Then Form.ActiveForm.ActiveMdiChild.BackgroundImage = My.Resources.TurquoiseBack And so on and so on for each background the user can choose from.... This code is in a setbackground() sub in a global module. Each time one of these maximized child forms open I run the Setbackground sub. on the " frmMainMDI.BackgroundImage = My.Resources.TurquoiseBack " I get a squiggly and it says that operator " = " is not defined for system.drawing.image and system.drawing.bitmap. The wierd thing is that if I type this same thing in after my "then" of the if statement I do not get the squiggly... This is kind of hard to explain because there is alot more to the way I am trying to accomplish this but this is just the part that is confusing me. Please, anyone that knows why I am getting this, please help me. Thank you!!!

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

      Joey Picerno wrote:

      on the " frmMainMDI.BackgroundImage = My.Resources.TurquoiseBack " I get a squiggly and it says that operator " = " is not defined for system.drawing.image and system.drawing.bitmap.

      It says this because you're trying to compare an Image object to an Image object, which you can't do. Why are you checking to see if the Background image is equal to something? If the rest of your explanation is any indicator, you shouldn't even have to check this. Your SetBackground code should just set the BackgroundImage and BackColor of all your forms without regard to what they currently are.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      J 2 Replies Last reply
      0
      • D Dave Kreskowiak

        Joey Picerno wrote:

        on the " frmMainMDI.BackgroundImage = My.Resources.TurquoiseBack " I get a squiggly and it says that operator " = " is not defined for system.drawing.image and system.drawing.bitmap.

        It says this because you're trying to compare an Image object to an Image object, which you can't do. Why are you checking to see if the Background image is equal to something? If the rest of your explanation is any indicator, you shouldn't even have to check this. Your SetBackground code should just set the BackgroundImage and BackColor of all your forms without regard to what they currently are.

        Dave Kreskowiak Microsoft MVP - Visual Basic

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

        when the user selects a new background (from images in my.resources) the MDI parent background changes. When they open say the Employee form (a child form that when opened stays maximized) I want that forms background image to change to the same one as the MDI parent's. The code I am working with is in a seperate module from these forms. thank you for your assistance with this.

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          Joey Picerno wrote:

          on the " frmMainMDI.BackgroundImage = My.Resources.TurquoiseBack " I get a squiggly and it says that operator " = " is not defined for system.drawing.image and system.drawing.bitmap.

          It says this because you're trying to compare an Image object to an Image object, which you can't do. Why are you checking to see if the Background image is equal to something? If the rest of your explanation is any indicator, you shouldn't even have to check this. Your SetBackground code should just set the BackgroundImage and BackColor of all your forms without regard to what they currently are.

          Dave Kreskowiak Microsoft MVP - Visual Basic

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

          Nevermind, I got it. Your explanation helped me out. I was trying to go to complex. I wasnt thinking simple enough... I always do that!!!!! Anyway, thank you for the help. Im sure I will be back soon, needing more. Have a good one!!! -Joey

          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