Condividi tramite


CPagerCtrl::SetBkColor

Sets the background color of the current pager control.

COLORREF SetBkColor(
         COLORREF clrBk
);

Parameters

Parameter

Description

[in] clrBk

A COLORREF value that contains the new background color of the pager control.

Requirements

Header: afxcmn.h

Return Value

A COLORREF value that contains the previous background color of the pager control.

Remarks

This method sends the PGM_SETBKCOLOR message, which is described in the Windows SDK.

Example

The following example uses the CPagerCtrl::SetBkColor method to set the background color of the pager control to red, and the CPagerCtrl::GetBkColor method to confirm that the change was made.

void CCSplitButton_s2Dlg::OnXColor()
{
    COLORREF originalColor;
    //  Set color to red.
    originalColor = m_pager.SetBkColor(RGB(255,0,0));
    if (m_pager.GetBkColor() != RGB(255,0,0))
    {
        MessageBox(_T("Control did not return RED as the previous color."));
    }
    // The following statement is one way to restore the color.
    // m_pager.SetBkColor( originalColor );
}

See Also

Concepts

CPagerCtrl Class

CPagerCtrl Members

Hierarchy Chart

PGM_SETBKCOLOR

CPagerCtrl::GetBkColor