|
-
May 16th, 1999, 07:19 PM
#1
Setting Focus
I've noticed that in the Windows Calculator program, when you clidk on
a button with the mouse, the button does not gain focus (i.e. it has
no dotted line border inside it).
How do I duplicate that behavior in my program? Whenever I click on a
CButton object in my window, it highlights the button. I don't want
the button to remain higlighted.
I've found a small work around by using SetFocus to return focus to
the window, but if I click and hold the button down and move out of
the button, the button remains highlighted.
My problem is I don't want that dotted border at all...If the Windows
Calculator can do it, then so can any other program, I assume.
Anyone know how to do this? Thanks.
--Greg
-
May 16th, 1999, 08:10 PM
#2
Re: Setting Focus
I don't have my MSDN CDs here to check this myself, but take a look under FocusRect and see if that gives any help.
-
May 16th, 1999, 10:01 PM
#3
Re: Setting Focus
GetDlgItem(YOUR_CTRL_ID)->SetFocus();
-
May 17th, 1999, 05:23 AM
#4
Re: Setting Focus
Hi,the answer is the buttons of the Calculater is
owner-draw style,so you can set the button's style
to owner-draw,and draw the button yourself.To do this,you must override the DrawItem() function,
please refer to the help sample.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|