Share via


CPagerCtrl::IsButtonInvisible

Indicates whether the specified scroll button of the current pager control is in invisible state.

BOOL IsButtonInvisible(
     int iButton
) const;

Requirements

Header: afxcmn.h

Parameters

Parameter

Description

[in] iButton

Indicates the button for which the state is retrieved. If the pager control style is PGS_HORZ, specify PGB_TOPORLEFT for the left button and PGB_BOTTOMORRIGHT for the right button. If the pager control style is PGS_VERT, specify PGB_TOPORLEFT for the top button and PGB_BOTTOMORRIGHT for the bottom button. For more information, see Pager Control Styles.

Return Value

true if the specified button is in invisible state; otherwise, false.

Remarks

Windows makes the scroll button in a particular direction invisible when the contained window is scrolled to its farthest extent because clicking the button further cannot bring more of the contained window into view.

This method sends the PGM_GETBUTTONSTATE message, which is described in the Windows SDK. It then tests whether the state that is returned is PGF_INVISIBLE. For more information, see the Return Value section of the PGM_GETBUTTONSTATE message.

Example

The following example uses the CPagerCtrl::IsButtonInvisible method to determine whether the pager control's left and right scroll buttons are visible.

void CCSplitButton_s2Dlg::OnXIsbuttoninvisible()
{
    BOOL bLeft  = m_pager.IsButtonInvisible(PGB_TOPORLEFT);
    BOOL bRight = m_pager.IsButtonInvisible(PGB_BOTTOMORRIGHT);
    CString str;
    str.Format(_T("The left button is%s visible; the right button is%s visible."), 
        (bLeft   ? _T(" not"):_T("")), 
        (bRight  ? _T(" not"):_T("")));
    MessageBox(str);
}

See Also

Reference

CPagerCtrl Class

Hierarchy Chart

PGM_GETBUTTONSTATE

CPagerCtrl::GetButtonState

Other Resources

CPagerCtrl Members