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. About SetIcon

About SetIcon

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionlearning
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.
  • O Offline
    O Offline
    olinn
    wrote on last edited by
    #1

    I want to paste a icon from resource to a button by using SetIcon(), but neither m_bttnOpen.SetIcon(AfxGetApp()->LoadIcon(IDI_ICON_OPEN)); nor m_bttnOpen.SetIcon(::LoadIcon(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON_OPEN))); can do this. Why? And how to do this by the most simple way? thankx

    R 1 Reply Last reply
    0
    • O olinn

      I want to paste a icon from resource to a button by using SetIcon(), but neither m_bttnOpen.SetIcon(AfxGetApp()->LoadIcon(IDI_ICON_OPEN)); nor m_bttnOpen.SetIcon(::LoadIcon(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON_OPEN))); can do this. Why? And how to do this by the most simple way? thankx

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      olinn wrote: Why? Has your button the icon style checked ? (Go in the ressource editor, right click on your button, tab "styles", check "Icon"). olinn wrote: And how to do this by the most simple way? This one :

      m_bttnOpen.SetIcon(::LoadIcon(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON_OPEN)));

      ~RaGE();

      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