CButton displayes dark edge after first click
-
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
-
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
Could it be focus rectangle drawn to the Button, Did you try taking the focus off the button, like pressing the Tab button.
-Prakash
-
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
-
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
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. -
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.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