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. changing user drawn bitmap button

changing user drawn bitmap button

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicsdata-structures
2 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.
  • D Offline
    D Offline
    Dimenser
    wrote on last edited by
    #1

    :doh:Using visual C++ 6.0, I have created a user drawn bitmap button and the up,down,focused,etc states and it works just fine. It's a red sphere, but I would like to be able to change it to blue,green,yellow,etc. I've tried m_pic1.AutoLoad(IDC_GREEN,this); where GREEN is the "GREENU" sphere picture, but it just crashes during run time. I think I may be really barking up the wrong tree. B

    V 1 Reply Last reply
    0
    • D Dimenser

      :doh:Using visual C++ 6.0, I have created a user drawn bitmap button and the up,down,focused,etc states and it works just fine. It's a red sphere, but I would like to be able to change it to blue,green,yellow,etc. I've tried m_pic1.AutoLoad(IDC_GREEN,this); where GREEN is the "GREENU" sphere picture, but it just crashes during run time. I think I may be really barking up the wrong tree. B

      V Offline
      V Offline
      V 0
      wrote on last edited by
      #2

      I think I would use an imagelist. Load all bmp's in there and switch accordingly. hope this helps. (eg. for setting an icon to a button I did this: icon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_PRINT), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR); pPrintbutton->SetIcon(icon); I presume it's round about the same for a bmp) "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

      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