BCGSoft Professional Editor for MFC
BOOL CBCGPEditCtrl::SetCaret ( int  nOffset,
BOOL  bScrollToCaret = TRUE,
BOOL  bRedrawOnScroll = TRUE,
BOOL  bCleanUpSelection = FALSE 
)

Sets the caret at the specified offset.

Returns
Nonzero if the function succeeds; otherwise 0.

Call this function to set the caret at the desired offset. This offset becomes the current offset and m_nCurrOffset member is updated.

Parameters
nOffsetSpecifies the zero-based offset from the beginning of the text.
bScrollToCaretIf TRUE, the edit control should be scrolled to the new caret position.
bRedrawOnScrollSpecifies whether the edit control should be redrawn if scrolling has occured as a result of this operation.
bCleanUpSelectionSpecifies whether the edit control's selection (if any) should be cleanned-up after caret position changing.