RichEdit::LineScroll
LineScroll
Description
Scrolls the text in this RichEdit control.
Syntax
void LineScroll( int nLines, int nChars = 0 )
Parameters
- nLines
- Specifies the number of lines to scroll vertically.
- nChars
- Specifies the number of character positions to scroll horizontally.
- This value is ignored if the rich edit control has either the ES_RIGHT or ES_CENTER style.
Return
Zero-based index of the uppermost visible line in this RichEdit control.
Remarks
Call this function to scroll the text of a multiple-line edit control.
The edit control does not scroll vertically past the last line of text
in the edit control. If the current line plus the number of lines specified
by nLines exceeds the total number of lines in the edit control,
the value is adjusted so that the last line of the edit control
is scrolled to the top of the edit-control window.
LineScroll can be used to scroll horizontally past the last character of any line.
Examples
EX1
#include <..\OriginLab\DialogEx.h>
#define IDC_RICHEDIT1 1001
void RichEdit_LineScroll(Dialog& EditBoxes)
{
RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1);
int nFirstVisible = richEdit.GetFirstVisibleLine();
// Scroll the rich edit control so that the first visible line is the first line of text.
if (nFirstVisible > 0)
richEdit.LineScroll(-nFirstVisible, 0);
}
Remark
See Also
header to Include
Control.h
|