Solved

Getting rid of the focus rectangle in a CButton

Posted on 1998-11-13
4
683 Views
Last Modified: 2013-11-20
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
Comment
Question by:jmfernau
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:Darren_Simons
ID: 1324644
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
 
LVL 7

Expert Comment

by:psdavis
ID: 1324645
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
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
ID: 1324646
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
 

Author Comment

by:jmfernau
ID: 1324647
that will work as a quick fix....

thanks,

Jon
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question