Background Color of Selected Item in Tree 
Author Message
 Background Color of Selected Item in Tree

Hello all,
I have been working on a custom CTreeCtrl and for some reason when I select
something in the tree the background color changes from white to gray
instead of the standard blue.  I have a regular tree in the same dialog and
it is blue as it should be.  Is there something I need to set to get this
back to the default color scheme?

Thanks
Marty



Mon, 21 Feb 2005 06:08:37 GMT  
 Background Color of Selected Item in Tree

Quote:

> Hello all,
> I have been working on a custom CTreeCtrl and for some reason when I select
> something in the tree the background color changes from white to gray
> instead of the standard blue.  I have a regular tree in the same dialog and
> it is blue as it should be.  Is there something I need to set to get this
> back to the default color scheme?

> Thanks
> Marty

What do you mean 'custom CTreeCtrl'? Is it child class from MFC-class
CTreeCtrl? If it is right, do you have overrided member function
OnPaint or something?
If property "Show selection always" of CTreeCtrl is checked and focus
is lost, then item is showed gray color instead of the standard blue.
Does your CTreeCtrl have imput focus?

-------------------------------------------------------
AlarIT developer

http://www.alarit.com



Mon, 21 Feb 2005 15:24:49 GMT  
 Background Color of Selected Item in Tree
Yes, my class is a child of CTreeCtrl.  I also have a child of CComboBox
that contains an instance of my treectrl.  So when the user drops the
combobox down it has a tree in it.
So I tried setting the focus in the OnPaint() function, and also in the
OnLButtonUp function (both in CMyTreeCtrl), but neither of those worked.
Any other suggestions?  I just want the L&F to be the same throughout the
app.
Thanks for the help.

Marty



Quote:
> > Hello all,
> > I have been working on a custom CTreeCtrl and for some reason when I
select
> > something in the tree the background color changes from white to gray
> > instead of the standard blue.  I have a regular tree in the same dialog
and
> > it is blue as it should be.  Is there something I need to set to get
this
> > back to the default color scheme?

> > Thanks
> > Marty

> What do you mean 'custom CTreeCtrl'? Is it child class from MFC-class
> CTreeCtrl? If it is right, do you have overrided member function
> OnPaint or something?
> If property "Show selection always" of CTreeCtrl is checked and focus
> is lost, then item is showed gray color instead of the standard blue.
> Does your CTreeCtrl have imput focus?

> -------------------------------------------------------
> AlarIT developer

> http://www.alarit.com



Tue, 22 Feb 2005 00:11:25 GMT  
 Background Color of Selected Item in Tree
I have looked further into this and the tree has lost its focus.  Is there
anyway to force the input focus to stay with the tree?
Marty


Quote:
> > Hello all,
> > I have been working on a custom CTreeCtrl and for some reason when I
select
> > something in the tree the background color changes from white to gray
> > instead of the standard blue.  I have a regular tree in the same dialog
and
> > it is blue as it should be.  Is there something I need to set to get
this
> > back to the default color scheme?

> > Thanks
> > Marty

> What do you mean 'custom CTreeCtrl'? Is it child class from MFC-class
> CTreeCtrl? If it is right, do you have overrided member function
> OnPaint or something?
> If property "Show selection always" of CTreeCtrl is checked and focus
> is lost, then item is showed gray color instead of the standard blue.
> Does your CTreeCtrl have imput focus?

> -------------------------------------------------------
> AlarIT developer

> http://www.alarit.com



Tue, 22 Feb 2005 06:47:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Background color for a single tree item

2. Tree control on DialogBox , How to get the selected item

3. Multi-select tree control items?

4. Q: MS VC4.2 Tree Control : Selecting item with right mouse click

5. How to update right hand pane when item selected in left hand pane tree

6. Change background color of selected text

7. Win2K: static background color vs. CFormView background color

8. changing the background color of tree control

9. Changing background color of icons in a tree control at runtime

10. How to change tree control background color?

11. changing tree view background color...

12. Tree background color with TVM_SETBKCOLOR

 

 
Powered by phpBB® Forum Software