ITextSelection::SetFlags method

Sets the text selection flags.

Syntax


HRESULT SetFlags(
  long Flags
);

Parameters

Flags

Type: long

New flag values. It can be any combination of the following.

Selection flagValueMeaning
tomSelStartActive1Start end is active.
tomSelAtEOL2For degenerate selections, the ambiguous character position corresponding to both the beginning of a line and the end of the preceding line should have the caret displayed at the end of the preceding line.
tomSelOvertype4Insert/Overtype mode is set to overtype.
tomSelActive8Selection is active.
tomSelReplace16Typing and pasting replaces selection.

 

Each of the table values is binary. Thus, if any value is not set, the text selection has the opposite property.

Return value

Type: HRESULT

The method returns S_OK.

Remarks

To make sure that the start end is active and that the ambiguous character position is displayed at the end of the line, execute the following code:


selection.Flags = tomSelStartActive + tomSelAtEOL

The Flags property is useful because an ITextRange object can select itself. With SetFlags, you can change the active end from the default value of End, select the caret position for an ambiguous character position, or change the Insert/Overtype mode.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Reference
ITextRange
ITextSelection
GetFlags
Conceptual
Text Object Model

 

 

Community Additions

ADD
Show:
© 2015 Microsoft