Поделиться через


CRichEditCtrl::GetSelectionType

Determines the selection type in this CRichEditCtrl object.

WORD GetSelectionType( ) const;

Возвращаемое значение

Flags indicating the contents of the current selection. A combination of the following flags:

  • SEL_EMPTY   Indicates that there is no current selection.

  • SEL_TEXT   Indicates that the current selection contains text.

  • SEL_OBJECT   Indicates that the current selection contains at least one OLE item.

  • SEL_MULTICHAR   Indicates that the current selection contains more than one character of text.

  • SEL_MULTIOBJECT   Indicates that the current selection contains more than one OLE object.

Заметки

For more information, see EM_SELECTIONTYPE in the Windows SDK.

Пример

// Dump the selection text only if it contains at least one text character.
if (m_myRichEditCtrl.GetSelectionType() & (SEL_TEXT | SEL_MULTICHAR))
{
   CString strText = m_myRichEditCtrl.GetSelText();

   TRACE(_T("selection text is '%s'.\r\n"), strText);
}

Требования

Header: afxcmn.h

См. также

Основные понятия

CRichEditCtrl Class

CRichEditCtrl Members

Hierarchy Chart

CRichEditCtrl::GetSel

CRichEditCtrl::GetSelText