![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как в RichEdit е в большом тексте вывести на экран нужный фрагмен
sasha_delphi © (2002-10-21 14:18:00)Как в RichEdit"е в большом тексте вывести на экран нужный фрагмент?
Arcus (2002-10-21 19:01:00) [1]Win32 Help
An application sends an EM_LINESCROLL message to scroll the text vertically or horizontally in a multiline edit control.
EM_LINESCROLL
wParam = (WPARAM) cxScroll; // characters to scroll horizontally
lParam = (LPARAM) cyScroll; // lines to scroll vertically
Т.е. делаешь
SendMessage(REdit.Handle, EM_LINESCROLL, -REdit.CaretPos.X, -REdit.CaretPos.Y);
sasha_delphi (2002-10-21 18:39:00) [2]Это все хорошо, и курсор в нужное место ставится, и выделяется
найденый фрагмент, но это все за экраном, не знаю как проскролировать RichEdit до нужного места.
sasha_delphi (2002-10-21 18:27:00) [3]где посмотреть EM_LINESCROLL, в Help"е не нашел.
Arcus (2002-10-21 16:32:00) [4]посмотри также EM_LINESCROLL
MegaBass (2002-10-21 16:23:00) [5]Searches a given range in the text for a target string.
type
TSearchType = (stWholeWord, stMatchCase);
TSearchTypes = set of TSearchType;
function FindText(const SearchStr: string; StartPos, Length: Integer; Options: TSearchTypes): Integer;
Description
Use FindText to search a range of text in a rich edit control for the string specified by the SearchStr parameter. Only the text in the range starting at the position StartPos and continuing through the next Length positions will be searched. Use Options to specify whether the search should match whole words only and whether the search should be case sensitive. FindText returns the position of the search string, where 0 is the position of the first character in the rich edit control (as opposed to the first position in the search range). If the search string does not appear in the indicated range, FindText returns -1.
Use FindText rather than programmatically searching through the text of the control, to keep from being thrown off by the encoding of rich text characteristics.
SelectStart, SelectLength
sasha_delphi (2002-10-21 16:13:00) [6]И что richedit1.paragraph
MegaBass (2002-10-21 15:47:00) [7]richedit1.paragraph
sasha_delphi (2002-10-21 15:45:00) [8]Не выделить, а показать на экране нужный фрагмент,
после заполнения RichEdit"а на экране последняя строка текста.
А надо вывести определенный абзац.
Arcus (2002-10-21 15:19:00) [9]Вывести в смысле "выделить"? Тогда SelStart / SelLength