Condividi tramite


CRichEditCtrl::GetSel

Recupera i limiti della selezione corrente in questo oggetto CRichEditCtrl.

void GetSel(
   CHARRANGE& cr 
) const;
void GetSel(
   long& nStartChar,
   long& nEndChar 
) const;

Parametri

  • cr
    Riferimento a una struttura CHARRANGE per ricevere i limiti della selezione corrente.

  • nStartChar
    Indice a base zero del primo carattere della selezione corrente.

  • nEndChar
    Indice a base zero dell'ultimo carattere della selezione corrente.

Note

I due forme di questa funzione forniscono modalità alternative ottenere i limiti della selezione.Una breve descrizione di questi form seguono:

  • GetSel( cr ) questo form viene utilizzata la struttura CHARRANGE con i relativi membri cpMax e cpMin per restituire i limiti.

  • GetSel( nStartChar**,** nEndChar ) questo form restituisce i limiti nei parametri nStartChar e nEndChar.

La selezione include tutto se l'inizio (cpMin o nStartChar) è 0 e fine (cpMax o nEndChar) è – 1.

Per ulteriori informazioni, vedere il messaggio EM_EXGETSEL e la struttura CHARRANGE in Windows SDK.

Esempio

// Set the selection to be all characters after the current selection.
long nStartChar, nEndChar;

m_myRichEditCtrl.GetSel(nStartChar, nEndChar); 
m_myRichEditCtrl.SetSel(nEndChar, -1);

Requisiti

Header: afxcmn.h

Vedere anche

Riferimenti

Classe di CRichEditCtrl

Grafico della gerarchia

CRichEditCtrl::SetSel

CRichEditCtrl::GetSelText

CRichEditCtrl::GetParaFormat

CRichEditCtrl::GetSelectionCharFormat