Compartilhar via


CTreeCtrl::SetTextColor

This member function implements the behavior of the Win32 message TVM_SETTEXTCOLOR, as described in the Windows SDK.

COLORREF SetTextColor(
   COLORREF clr 
);

Parameters

  • clr
    A COLORREF value that contains the new text color. If this argument is -1, the control will revert to using the system color for the text color.

Return Value

A COLORREF value that represents the previous text color. If this value is -1, the control was using the system color for the text color.

Example

// change text color to white and background to dark blue
m_TreeCtrl.SetTextColor(RGB(255, 255, 255));
ASSERT(m_TreeCtrl.GetTextColor() == RGB(255, 255, 255));
m_TreeCtrl.SetBkColor(RGB(0, 0, 128));
ASSERT(m_TreeCtrl.GetBkColor() == RGB(0, 0, 128));

// force repaint immediately
m_TreeCtrl.Invalidate();

Requirements

Header: afxcmn.h

See Also

Reference

CTreeCtrl Class

Hierarchy Chart

CTreeCtrl::GetTextColor

Other Resources

CTreeCtrl Members