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. CButton displayes dark edge after first click

CButton displayes dark edge after first click

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 4 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.
  • S Offline
    S Offline
    spiritofklanawa
    wrote on last edited by
    #1

    I create a button at runtime using CButton.Create() function. The button looks fine until it is clicked the first time. From then on the black rectangle around the button becomes slightly wider and does not go away with releasing the button. It's cosmetic problem only, subtle but annoying nevertheless. I suspect it's something to do with window-style and extended-window-style but I had no success so far. Thanks in advance for your suggestions.:sigh: spiritofklanawa

    P D M 3 Replies Last reply
    0
    • S spiritofklanawa

      I create a button at runtime using CButton.Create() function. The button looks fine until it is clicked the first time. From then on the black rectangle around the button becomes slightly wider and does not go away with releasing the button. It's cosmetic problem only, subtle but annoying nevertheless. I suspect it's something to do with window-style and extended-window-style but I had no success so far. Thanks in advance for your suggestions.:sigh: spiritofklanawa

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      Could it be focus rectangle drawn to the Button, Did you try taking the focus off the button, like pressing the Tab button.


      -Prakash

      1 Reply Last reply
      0
      • S spiritofklanawa

        I create a button at runtime using CButton.Create() function. The button looks fine until it is clicked the first time. From then on the black rectangle around the button becomes slightly wider and does not go away with releasing the button. It's cosmetic problem only, subtle but annoying nevertheless. I suspect it's something to do with window-style and extended-window-style but I had no success so far. Thanks in advance for your suggestions.:sigh: spiritofklanawa

        D Offline
        D Offline
        dipuks
        wrote on last edited by
        #3

        If you are trying to use a push button, then make sure you put style as BS_PUSHBUTTON. You can also try, SetState(FALSE);, which will remove any highlighting

        1 Reply Last reply
        0
        • S spiritofklanawa

          I create a button at runtime using CButton.Create() function. The button looks fine until it is clicked the first time. From then on the black rectangle around the button becomes slightly wider and does not go away with releasing the button. It's cosmetic problem only, subtle but annoying nevertheless. I suspect it's something to do with window-style and extended-window-style but I had no success so far. Thanks in advance for your suggestions.:sigh: spiritofklanawa

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          The extra-dark border marks the default button. If more than one button has the BS_DEFPUSHBUTTON style, that will muck up the dialog manager and buttons will be drawn incorrectly. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Laugh it up, fuzzball.

          S 1 Reply Last reply
          0
          • M Michael Dunn

            The extra-dark border marks the default button. If more than one button has the BS_DEFPUSHBUTTON style, that will muck up the dialog manager and buttons will be drawn incorrectly. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Laugh it up, fuzzball.

            S Offline
            S Offline
            spiritofklanawa
            wrote on last edited by
            #5

            that was it ! I just added a line of code in the BN_CLICKED message handler to remove the "BS_DEFPUSHBUTTON" style. The trouble was that multiple buttons showed this dark outline which looked goofy. Thanks

            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