Solved

Getting rid of the focus rectangle in a CButton

Posted on 1998-11-13
4
705 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

729 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