CWnd::SetCaretPos

将插入符号的位置。

static void PASCAL SetCaretPos( 
   POINT point  
);

参数

  • point
    指定新的x和Y坐标(在工作区坐标)插入符号。

备注

才会由当前任务,的一个窗口拥有 SetCaretPos 成员函数移动脱字号。 SetCaretPos 将插入符号插入符号是否为隐藏的。

插入符号是共享资源。 如果它拥有插入符号,窗口不应将脱字号。

示例

// The following code snippet shows a caret when the left  
// mouse button is pressed, and sets the caret's positon to  
// the cursor's position. 
void CMyView::OnLButtonDown(UINT nFlags, CPoint point) 
{
   //create a solid caret, the width is 2, the length is 20.
   CreateSolidCaret(2, 20);

   SetCaretPos(point);
   ShowCaret();

   CView::OnLButtonDown(nFlags, point);
}

要求

Header: afxwin.h

请参见

参考

CWnd 类

层次结构图

CWnd::GetCaretPos

SetCaretPos