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
Solved

Getting rid of the focus rectangle in a CButton

Posted on 1998-11-13
4
668 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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
Error on moodle after upgrade 3 140
sumDigits challenge 9 170
bigDiff challenge 17 125
Excel file not created as expected 7 79
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.

856 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