Solved

Getting rid of the focus rectangle in a CButton

Posted on 1998-11-13
4
713 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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

617 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