CButton - change background color problem 
Author Message
 CButton - change background color problem

I've (almost) successfully managed to change the background colour of a
CButton, using the ON_WM_CTLCOLOR_REFLECT as is normal practice for CStatic,
I'm also overriding ON_WMLBUTTONDOWN, ON_WMSETFOCUS and ON_WM_KILLFOCUS, so
that I can have a highlighted and unhighlighted button background color.

If I define 2 of these on a dialog if I tap on 1 it changes color correctly,
and the tap on button 2, button 1 changes back to the unhighlight background
color, but if instead, I hold the stylus down on button 2 then button1
remains in the highlighted state. Anyone any ideas?

Thanks
Roger



Sat, 29 Oct 2005 03:20:36 GMT  
 CButton - change background color problem
Roger, what changes are you making to the background color on these events?

MP


Quote:
> I've (almost) successfully managed to change the background colour of a
> CButton, using the ON_WM_CTLCOLOR_REFLECT as is normal practice for
CStatic,
> I'm also overriding ON_WMLBUTTONDOWN, ON_WMSETFOCUS and ON_WM_KILLFOCUS,
so
> that I can have a highlighted and unhighlighted button background color.

> If I define 2 of these on a dialog if I tap on 1 it changes color
correctly,
> and the tap on button 2, button 1 changes back to the unhighlight
background
> color, but if instead, I hold the stylus down on button 2 then button1
> remains in the highlighted state. Anyone any ideas?

> Thanks
> Roger



Sat, 29 Oct 2005 07:18:09 GMT  
 CButton - change background color problem

I think these article will help you:
http://www.pocketpcdn.com/articles/mfcbuttonbug.html

--
Sincerely,
Alexander


http://www.RSDN.ru - Russian Software Developer Network


Quote:
> I've (almost) successfully managed to change the background colour of a
> CButton, using the ON_WM_CTLCOLOR_REFLECT as is normal practice for
CStatic,
> I'm also overriding ON_WMLBUTTONDOWN, ON_WMSETFOCUS and ON_WM_KILLFOCUS,
so
> that I can have a highlighted and unhighlighted button background color.

> If I define 2 of these on a dialog if I tap on 1 it changes color
correctly,
> and the tap on button 2, button 1 changes back to the unhighlight
background
> color, but if instead, I hold the stylus down on button 2 then button1
> remains in the highlighted state. Anyone any ideas?

> Thanks
> Roger



Sat, 29 Oct 2005 17:03:41 GMT  
 CButton - change background color problem
Thanks,

When are Microsoft going to issue a service pack for EVC 3.0? the
notification bug is causing me to have to override practcally every control,
and seems to be the root of all ui bugs.

Thanks
Roger Womack


Quote:

> I think these article will help you:
> http://www.pocketpcdn.com/articles/mfcbuttonbug.html

> --
> Sincerely,
> Alexander


> http://www.RSDN.ru - Russian Software Developer Network



> > I've (almost) successfully managed to change the background colour of a
> > CButton, using the ON_WM_CTLCOLOR_REFLECT as is normal practice for
> CStatic,
> > I'm also overriding ON_WMLBUTTONDOWN, ON_WMSETFOCUS and ON_WM_KILLFOCUS,
> so
> > that I can have a highlighted and unhighlighted button background color.

> > If I define 2 of these on a dialog if I tap on 1 it changes color
> correctly,
> > and the tap on button 2, button 1 changes back to the unhighlight
> background
> > color, but if instead, I hold the stylus down on button 2 then button1
> > remains in the highlighted state. Anyone any ideas?

> > Thanks
> > Roger



Sat, 29 Oct 2005 23:20:09 GMT  
 CButton - change background color problem

You don't need to override every single control, there are always some
walkarounds. For instance, you could trap WM_LBUTTONDOWN in
PreTranslateMessage, you could avoid subclassing controls with MFC classes
and use GetDlgItem instead etc.

I don't think it's am only root of all UI bugs, there are other bugs for
this. ;)

As to service pack, this is not possible since MFC library (release version
of it) is part of Pocket PC platform and is supplied with all devices (in
device ROM). So patching eVC will not help at all. As to fixing this bug in
future versions of MFC, I doubt that this will happen. The bug we are
discussing may in fact be a feature. ;-)

--
Sincerely,
Alexander


http://www.RSDN.ru - Russian Software Developer Network


Quote:
> Thanks,

> When are Microsoft going to issue a service pack for EVC 3.0? the
> notification bug is causing me to have to override practcally every
control,
> and seems to be the root of all ui bugs.

> Thanks
> Roger Womack



> > I think these article will help you:
> > http://www.pocketpcdn.com/articles/mfcbuttonbug.html

> > --
> > Sincerely,
> > Alexander


> > http://www.RSDN.ru - Russian Software Developer Network



> > > I've (almost) successfully managed to change the background colour of
a
> > > CButton, using the ON_WM_CTLCOLOR_REFLECT as is normal practice for
> > CStatic,
> > > I'm also overriding ON_WMLBUTTONDOWN, ON_WMSETFOCUS and
ON_WM_KILLFOCUS,
> > so
> > > that I can have a highlighted and unhighlighted button background
color.

> > > If I define 2 of these on a dialog if I tap on 1 it changes color
> > correctly,
> > > and the tap on button 2, button 1 changes back to the unhighlight
> > background
> > > color, but if instead, I hold the stylus down on button 2 then button1
> > > remains in the highlighted state. Anyone any ideas?

> > > Thanks
> > > Roger



Sun, 30 Oct 2005 13:43:02 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Change CButton color and CButton text color in CDialog

2. Change background color of CButton

3. Change background and text color in CButton

4. set the text color and the background color of a Control Cbutton

5. Changing the Background Color of a Dialog to match the background of a Bitmap

6. Changing Background Color of CEdit - Problem With Double Clicking On Texts

7. Problem changing CEditView background color.

8. Change text color and background color in CEditView

9. Background Color of CButton

10. Change a part of Background color or a part of text color from CListCtrl

11. problem: How to change the background color of menu items and menu bar

12. Setting background color of a CButton?

 

 
Powered by phpBB® Forum Software