CWnd::SetCaretPos

Ustawia położenie kursora.

static void PASCAL SetCaretPos( 
   POINT point  
);

Parametry

  • point
    Określa nowy x i y współrzędne kursora (w współrzędne klienta).

Uwagi

SetCaretPos Funkcji składowej przenosi kursora tylko wtedy, gdy jest własnością okna dla bieżącego zadania.SetCaretPosPrzenosi kursora, niezależnie od tego, czy kursora jest ukryty.

Daszek jest zasobem udostępnionym.Jeśli nie jest właścicielem znaku karetki kursora nie należy przenosić okna.

Przykład

// 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);
}

Wymagania

Nagłówek: afxwin.h

Zobacz też

Informacje

Klasa CWnd

Diagram hierarchii

CWnd::GetCaretPos

SetCaretPos