Partager via


CMonthCalCtrl::SetCalendarBorder

Sets the width of the border of the current month calendar control.

void SetCalendarBorder(
     int cxyBorder
);

Parameters

Parameter

Description

[in] cxyBorder

The width of the border, in pixels.

Remarks

If this method succeeds, the border width is set to the cxyBorder parameter. Otherwise, the border width is reset to the default value that is specified by the current theme, or zero if themes are not used.

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

Requirements

Header: afxdtctl.h

This control is supported in Windows Vista and later.

Additional requirements for this method are described in Build Requirements for Windows Vista Common Controls.

Example

The following code example defines the variable, m_monthCalCtrl, that is used to programmatically access the month calendar control. This variable is used in the next example.

  // Variable used to reference the month calendar control.
    CMonthCalCtrl m_monthCalCtrl;
    // Variable used to reference the splitbutton control.
    CSplitButton m_splitButton;

The following code example sets the border width of the month calendar control to eight pixels. Use the CMonthCalCtrl::GetCalendarBorder method to determine whether this method succeeded.

// Use the GetCalendarBorder() method to determine whether  
    // this method succeeded or failed.
    m_monthCalCtrl.SetCalendarBorder( 8 );

See Also

Reference

CMonthCalCtrl Class

Hierarchy Chart

CMonthCalCtrl::SetCalendarBorderDefault

MCM_SETCALENDARBORDER

Themes and Visual Styles