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 / C++ / MFC
  4. CBitmapButton

CBitmapButton

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 5 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.
  • D Offline
    D Offline
    dart13
    wrote on last edited by
    #1

    I want to create CBitmapButton in a dialog with CButton::Create(), but for some reason the button is not visible when I run the app. I put the following code in CDialog::OnInitDialog() VERIFY(m_whiteBtn2.Create("", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_OWNERDRAW, CRect(200, 100,85,48), this, IDC_WHITE_BUTTON2)); VERIFY(m_whiteBtn2.LoadBitmaps(IDB_WHITE_BUTTONU, IDB_WHITE_BUTTOND)); Does anyone know what might be the problem?

    I R D G 4 Replies Last reply
    0
    • D dart13

      I want to create CBitmapButton in a dialog with CButton::Create(), but for some reason the button is not visible when I run the app. I put the following code in CDialog::OnInitDialog() VERIFY(m_whiteBtn2.Create("", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_OWNERDRAW, CRect(200, 100,85,48), this, IDC_WHITE_BUTTON2)); VERIFY(m_whiteBtn2.LoadBitmaps(IDB_WHITE_BUTTONU, IDB_WHITE_BUTTOND)); Does anyone know what might be the problem?

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      You might want to try BS_BITMAP... Iain.

      1 Reply Last reply
      0
      • D dart13

        I want to create CBitmapButton in a dialog with CButton::Create(), but for some reason the button is not visible when I run the app. I put the following code in CDialog::OnInitDialog() VERIFY(m_whiteBtn2.Create("", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_OWNERDRAW, CRect(200, 100,85,48), this, IDC_WHITE_BUTTON2)); VERIFY(m_whiteBtn2.LoadBitmaps(IDB_WHITE_BUTTONU, IDB_WHITE_BUTTOND)); Does anyone know what might be the problem?

        R Offline
        R Offline
        Rick York
        wrote on last edited by
        #3

        This article : http://www.codeproject.com/editctrl/smartedit.asp[^] shows an example of how to use bitmapped buttons. __________________________________________ a two cent stamp short of going postal.

        D 1 Reply Last reply
        0
        • D dart13

          I want to create CBitmapButton in a dialog with CButton::Create(), but for some reason the button is not visible when I run the app. I put the following code in CDialog::OnInitDialog() VERIFY(m_whiteBtn2.Create("", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_OWNERDRAW, CRect(200, 100,85,48), this, IDC_WHITE_BUTTON2)); VERIFY(m_whiteBtn2.LoadBitmaps(IDB_WHITE_BUTTONU, IDB_WHITE_BUTTOND)); Does anyone know what might be the problem?

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          In case you don't get your code working, see this article.


          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

          1 Reply Last reply
          0
          • R Rick York

            This article : http://www.codeproject.com/editctrl/smartedit.asp[^] shows an example of how to use bitmapped buttons. __________________________________________ a two cent stamp short of going postal.

            D Offline
            D Offline
            dart13
            wrote on last edited by
            #5

            I've already made it work by using AutoLoad(), but I'm having problems with using CButton::Create().

            1 Reply Last reply
            0
            • D dart13

              I want to create CBitmapButton in a dialog with CButton::Create(), but for some reason the button is not visible when I run the app. I put the following code in CDialog::OnInitDialog() VERIFY(m_whiteBtn2.Create("", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_OWNERDRAW, CRect(200, 100,85,48), this, IDC_WHITE_BUTTON2)); VERIFY(m_whiteBtn2.LoadBitmaps(IDB_WHITE_BUTTONU, IDB_WHITE_BUTTOND)); Does anyone know what might be the problem?

              G Offline
              G Offline
              Gary R Wheeler
              wrote on last edited by
              #6

              After calling the button's Create(...) method, you must call its ShowWindow(SW_SHOW); method to actually show the window.


              Software Zen: delete this;

              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