Export (0) Print
Expand All

CEdit::SetSel

Call this function to select a range of characters in an edit control.

void SetSel( 
   DWORD dwSelection, 
   BOOL bNoScroll = FALSE  
); 
void SetSel( 
   int nStartChar, 
   int nEndChar, 
   BOOL bNoScroll = FALSE  
);

dwSelection

Specifies the starting position in the low-order word and the ending position in the high-order word. If the low-order word is 0 and the high-order word is –1, all the text in the edit control is selected. If the low-order word is –1, any current selection is removed.

bNoScroll

Indicates whether the caret should be scrolled into view. If FALSE, the caret is scrolled into view. If TRUE, the caret is not scrolled into view.

nStartChar

Specifies the starting position. If nStartChar is 0 and nEndChar is –1, all the text in the edit control is selected. If nStartChar is –1, any current selection is removed.

nEndChar

Specifies the ending position.

For more information, see EM_SETSEL in the Windows SDK.

See the example for CEdit::GetSel.

Header: afxwin.h

Community Additions

ADD
Show:
© 2014 Microsoft