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. C / C++ / MFC
  4. Disabling buttons with bitmaps

Disabling buttons with bitmaps

Scheduled Pinned Locked Moved C / C++ / MFC
graphicstutorialquestion
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.
  • L Offline
    L Offline
    Luis E Cuadrado
    wrote on last edited by
    #1

    Hi: Does anyone know how to disable a button that has a bitmap on it? I'm trying with EnableWindow(TRUE/FALSE) and it disables the button but the bitmap it's gone. Any ideas? One more thing, the buttons are in a dialog. Any answer is more than welcome. Have a good day, Luis E. Cuadrado :0)

    A 1 Reply Last reply
    0
    • L Luis E Cuadrado

      Hi: Does anyone know how to disable a button that has a bitmap on it? I'm trying with EnableWindow(TRUE/FALSE) and it disables the button but the bitmap it's gone. Any ideas? One more thing, the buttons are in a dialog. Any answer is more than welcome. Have a good day, Luis E. Cuadrado :0)

      A Offline
      A Offline
      Alvaro Mendez
      wrote on last edited by
      #2

      What kind of button is this? I mean, it's not your plain-vanilla CButton, right? Could it be that it's expecting a bitmap for the "Disabled" state, which you haven't provided? Regards, Alvaro


      Well done is better than well said. -- Benjamin Franklin (I actually prefer medium-well.)

      L 1 Reply Last reply
      0
      • A Alvaro Mendez

        What kind of button is this? I mean, it's not your plain-vanilla CButton, right? Could it be that it's expecting a bitmap for the "Disabled" state, which you haven't provided? Regards, Alvaro


        Well done is better than well said. -- Benjamin Franklin (I actually prefer medium-well.)

        L Offline
        L Offline
        Luis E Cuadrado
        wrote on last edited by
        #3

        plain-vanilla CButton...that was a good one :laugh: Well, I think is a CButton because I added a member varialbe using Class Wizzard, and the button has an object ID. To be honest, I didn't wrote the code to make the button enabled and working. Someone else did it and is not with us anymore. I worked with the regular buttons before, but not with those that have bitmaps on it. I was looking arround the code and this is what I think the other person did: m_autoBitmap.LoadBitmap(IDB_AUTO); ::SendMessage(::GetDlgItem(m_hWnd, ID_AUTO_BTN), BM_SETIMAGE, IMAGE_BITMAP, (long)m_autoBitmap.operator HBITMAP()); Does this helps? If you need anything else let me know. Thanks again Alvaro, Luis E. Cuadrado :0)

        A 1 Reply Last reply
        0
        • L Luis E Cuadrado

          plain-vanilla CButton...that was a good one :laugh: Well, I think is a CButton because I added a member varialbe using Class Wizzard, and the button has an object ID. To be honest, I didn't wrote the code to make the button enabled and working. Someone else did it and is not with us anymore. I worked with the regular buttons before, but not with those that have bitmaps on it. I was looking arround the code and this is what I think the other person did: m_autoBitmap.LoadBitmap(IDB_AUTO); ::SendMessage(::GetDlgItem(m_hWnd, ID_AUTO_BTN), BM_SETIMAGE, IMAGE_BITMAP, (long)m_autoBitmap.operator HBITMAP()); Does this helps? If you need anything else let me know. Thanks again Alvaro, Luis E. Cuadrado :0)

          A Offline
          A Offline
          Alvaro Mendez
          wrote on last edited by
          #4

          Check the properties for ID_AUTO_BTN (in the resource editor). Make sure it has "Bitmap" checked. I'm not familiar with regular buttons with bitmaps, using the CButton class. You may want to consider using the CBitmapButton class instead which handles 4 different images for the different states. I don't know if CButton handles the Disabled state properly. Regards, Alvaro


          Well done is better than well said. -- Benjamin Franklin (I actually prefer medium-well.)

          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