Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 756
  • Last Modified:

Getting rid of the focus rectangle in a CButton

I have a button in which I use a SetBitmap call to put a bitmap on the button.  Everything works ok, but when the button has the focus there is a "focus" rectangle drawn on top of the Bitmap.  Normally, I wouldn't care, but this button is small and the "focus" rectangle hides most of the bitmap.  How do I get rid of this "focus" rectangle?  I could probably use a CBitmapButton but is there a way to do it using CButton?????

thanks,

Jon
0
jmfernau
Asked:
jmfernau
1 Solution
 
Darren_SimonsCommented:
I've looked as some code I've written which uses a CButton which is set to be owner-drawn and it doesn't have the problem about focus rectangles. Is your button owner-drawn? Also, how about disabling it as a tab-stop?

0
 
psdavisCommented:
Disabling the tab-stop will only change the focus if tabbed to it.  Won't the rectangle still show up once it has been clicked?
0
 
MikeP090797Commented:
Add a hidden checkbox to your dialog, make it's WS_VISIBLE true, but put it beyond the borders of it. In the click notification, simply SetFocus on that checkbox
0
 
jmfernauAuthor Commented:
that will work as a quick fix....

thanks,

Jon
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now