CButton::SetCursor

调用该成员函数的关联新光标与按钮。

HCURSOR SetCursor(
   HCURSOR hCursor 
);

参数

  • hCursor
    光标的句柄。

返回值

光标的句柄之前与按钮。

备注

默认情况下将光标定位在按钮的文本将自动放置,集中。 如果光标为按钮太大,它不在任何一方将剪辑。 您可以选择其他对齐选项,包括:

  • BS_TOP

  • BS_LEFT

  • BS_RIGHT

  • BS_CENTER

  • BS_BOTTOM

  • BS_VCENTER

不同 CBitmapButton,使用每个按钮四个位图,SetCursor 只使用每个按钮的光标。 当按下时,光标会转换然后在右侧的下。

示例

CButton myIconButton;

// Create an icon button.
myIconButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_ICON, 
   CRect(10,10,60,50), pParentWnd, 1);

// If no image is defined for the button, define the image to the
// system arrow and question mark cursor.
if (myIconButton.GetCursor() == NULL)
   myIconButton.SetCursor(::LoadCursor(NULL, IDC_HELP));

要求

Header: afxwin.h

请参见

参考

CButton选件类

层次结构图

CButton::GetCursor

CBitmapButton::LoadBitmaps

Bitmaps