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. Icon on Button not display in XP.

Icon on Button not display in XP.

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 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
    Le rner
    wrote on last edited by
    #1

    Hi all, I am setIcon on button,its working fine on vista or windows 7 but on xp the icon on button not displayed only text is displayed.

    HICON addIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON_HELP),IMAGE_ICON, 24, 24, LR_DEFAULTCOLOR);

     m\_btn.SetIcon(addIcon);
    

    how can I display the icon on button in xp. thanks in advance.

    L _ 2 Replies Last reply
    0
    • L Le rner

      Hi all, I am setIcon on button,its working fine on vista or windows 7 but on xp the icon on button not displayed only text is displayed.

      HICON addIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON_HELP),IMAGE_ICON, 24, 24, LR_DEFAULTCOLOR);

       m\_btn.SetIcon(addIcon);
      

      how can I display the icon on button in xp. thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You can't. Although the documentation suggests otherwise, it does not work in Windows XP.

      Use the best guess

      L 1 Reply Last reply
      0
      • L Lost User

        You can't. Although the documentation suggests otherwise, it does not work in Windows XP.

        Use the best guess

        L Offline
        L Offline
        Le rner
        wrote on last edited by
        #3

        how can I do this with any other method

        L 1 Reply Last reply
        0
        • L Le rner

          how can I do this with any other method

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You could try making a Custom Control[^].

          Use the best guess

          1 Reply Last reply
          0
          • L Le rner

            Hi all, I am setIcon on button,its working fine on vista or windows 7 but on xp the icon on button not displayed only text is displayed.

            HICON addIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON_HELP),IMAGE_ICON, 24, 24, LR_DEFAULTCOLOR);

             m\_btn.SetIcon(addIcon);
            

            how can I display the icon on button in xp. thanks in advance.

            _ Offline
            _ Offline
            _AnsHUMAN_
            wrote on last edited by
            #5

            Can you change the icon to bitmap and try CBitmapButton class to load it on the button?

            You talk about Being HUMAN. I have it in my name AnsHUMAN

            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