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. icon on button not displayed in XP.

icon on button not displayed in XP.

Scheduled Pinned Locked Moved C / C++ / MFC
help
27 Posts 3 Posters 5 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 Lost User

    I suspect the error 87 should be ignored as you have not checked if the previous function was successful or not. You can validate that by calling SetLastError(0) before the SetIcon() call. You also say that when you set icon style to FALSE it does not display the icon; isn't that what it should do?

    V Offline
    V Offline
    VCProgrammer
    wrote on last edited by
    #16

    i set icon style to FALSE,coz i dont want only icon on button is display i want icon and text both are display on button....

    L 1 Reply Last reply
    0
    • V VCProgrammer

      i set icon style to FALSE,coz i dont want only icon on button is display i want icon and text both are display on button....

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

      See the remarks section[^].

      V 1 Reply Last reply
      0
      • L Lost User

        See the remarks section[^].

        V Offline
        V Offline
        VCProgrammer
        wrote on last edited by
        #18

        thanks for your guidance and support ,but please help me what function use to display text and icon on button....

        L 1 Reply Last reply
        0
        • V VCProgrammer

          thanks for your guidance and support ,but please help me what function use to display text and icon on button....

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

          Use the methods and properties as described in the documentation[^].

          V 1 Reply Last reply
          0
          • L Lost User

            Use the methods and properties as described in the documentation[^].

            V Offline
            V Offline
            VCProgrammer
            wrote on last edited by
            #20

            according to the documentationt set icon on button use CButton:SetIcon method,that have i already used...as you know also is not working fine...

            L 1 Reply Last reply
            0
            • V VCProgrammer

              according to the documentationt set icon on button use CButton:SetIcon method,that have i already used...as you know also is not working fine...

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

              I just tested this on my system and it works fine, using the BM_SETIMAGE message. I am not sure how you would do that in MFC but I guess in much the same way.

              V 1 Reply Last reply
              0
              • L Lost User

                I just tested this on my system and it works fine, using the BM_SETIMAGE message. I am not sure how you would do that in MFC but I guess in much the same way.

                V Offline
                V Offline
                VCProgrammer
                wrote on last edited by
                #22

                sir you tested this on XP?

                L 1 Reply Last reply
                0
                • V VCProgrammer

                  sir you tested this on XP?

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

                  No, Windows 7.

                  V 1 Reply Last reply
                  0
                  • L Lost User

                    No, Windows 7.

                    V Offline
                    V Offline
                    VCProgrammer
                    wrote on last edited by
                    #24

                    sir i already told so many times os version upper than XP, my code also working fine, the problem is just about XP and lower version...

                    L 2 Replies Last reply
                    0
                    • V VCProgrammer

                      sir i already told so many times os version upper than XP, my code also working fine, the problem is just about XP and lower version...

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

                      Do you have Visual Styles enabled[^]?

                      1 Reply Last reply
                      0
                      • V VCProgrammer

                        sir i already told so many times os version upper than XP, my code also working fine, the problem is just about XP and lower version...

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

                        I have managed to get my XP VM set up and have run a number of tests but cannot make this work. Having a look around with Google it seems that this feature does not work on XP, despite the fact that the MSDN documentation states that this should work on versions from Windows 2000 and above. It looks like you are stuck, and the only solution is to decide whether to use text or icon in your product.

                        V 1 Reply Last reply
                        0
                        • L Lost User

                          I have managed to get my XP VM set up and have run a number of tests but cannot make this work. Having a look around with Google it seems that this feature does not work on XP, despite the fact that the MSDN documentation states that this should work on versions from Windows 2000 and above. It looks like you are stuck, and the only solution is to decide whether to use text or icon in your product.

                          V Offline
                          V Offline
                          VCProgrammer
                          wrote on last edited by
                          #27

                          yes sir thanks... i am using now NM_CUSTOMDRAW and its solve my problem...

                          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