Discussion:
Remove button's bold border (highlight?)
(too old to reply)
Flaxie
2007-06-25 08:06:00 UTC
Permalink
Hi

Win32 api, how can I remove button's bold border (highlight?) by code.

How do I set highlight area on button:
* I press left mouse-button down on win32 application button
* I move cursor outside of win32 application button
* I release left mouse-button
-> Button will be focused, and it will have bold border (probably highlight)

I can remove focus, just that I use: SetFocus(AnyOtherHWND);
But this SetFocus(); doesn't remove bold border on win32 application button.
I have tried:
SendMessage(buttonHWND, BM_SETSTATE, 0,0);
SendMessage(buttonHWND, WM_KILLFOCUS, 0,0);
.... and some others, but I have failed to remove that bold border on button.
Flaxie
2007-06-25 10:58:00 UTC
Permalink
Got it, had to send new SET_STYLE message to buttonHWND with pushbutton.
Post by Flaxie
Hi
Win32 api, how can I remove button's bold border (highlight?) by code.
* I press left mouse-button down on win32 application button
* I move cursor outside of win32 application button
* I release left mouse-button
-> Button will be focused, and it will have bold border (probably highlight)
I can remove focus, just that I use: SetFocus(AnyOtherHWND);
But this SetFocus(); doesn't remove bold border on win32 application button.
SendMessage(buttonHWND, BM_SETSTATE, 0,0);
SendMessage(buttonHWND, WM_KILLFOCUS, 0,0);
.... and some others, but I have failed to remove that bold border on button.
David Lowndes
2007-06-25 12:47:36 UTC
Permalink
Post by Flaxie
I can remove focus, just that I use: SetFocus(AnyOtherHWND);
But this SetFocus(); doesn't remove bold border on win32 application button.
The recommended way is to use WM_NEXTDLGCTL - it does the extra things
for you.

Dave
r***@pen_fact.com
2007-06-25 18:15:53 UTC
Permalink
On Mon, 25 Jun 2007 01:06:00 -0700, Flaxie
Post by Flaxie
Hi
Win32 api, how can I remove button's bold border (highlight?) by code.
If you're trying to get rid of the default button indicator, then I
think you need to
a) change the button's style from BS_DEFPUSHBUTTON to BS_PUSHBUTTON
b) send a DM_SETDEFID to the buttons parent
Here are relevant comments from my code:
// Mostly from Richter and Locke 1995
// But Cherno Jagne [MS] (microsoft.public.pocketpc.developer, 6
Sep 01,
// "How to change default pushbutton using API call" suggest the
following:
// http://support.microsoft.com/support/kb/articles/q67/6/55.asp
// See also "User Interface Programming", Peter Hesselberg,
// _Windows Developer's Journal_, April, 2000, pp 46-54
// Also from Norman Bullen 2 Feb 99 in
comp.os.ms-windows.programmer.win32
Post by Flaxie
* I press left mouse-button down on win32 application button
* I move cursor outside of win32 application button
* I release left mouse-button
-> Button will be focused, and it will have bold border (probably highlight)
I can remove focus, just that I use: SetFocus(AnyOtherHWND);
But this SetFocus(); doesn't remove bold border on win32 application button.
SendMessage(buttonHWND, BM_SETSTATE, 0,0);
SendMessage(buttonHWND, WM_KILLFOCUS, 0,0);
.... and some others, but I have failed to remove that bold border on button.
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com

Continue reading on narkive:
Loading...