Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > C/C++: Системное программирование и WinAPI > Прокрутка текста в Edit


Автор: Brodyaga 24.7.2009, 06:29
Всем здравствуйте!
Мне нужно создать две кнопки, аналог кнопкам полосы прокрутки у контрола Edit. В связи с этим заинтересовался тем, как происходит прокрутка у Edit'а. Может ему можно послать какие то сообщения для прокрутки текста вниз или вверх?

Автор: Andrey44 24.7.2009, 06:45
EM_LINESCROLL 

Автор: Brodyaga 27.7.2009, 13:56
Цитата

lParam    Количество символов, на которое надо прокрутить вертикальную полосу

это http://netlive.narod.ru/apimes/editm.html#000m20

Получается, чтобы крутить вверх, нужно это значение в -1 указывать?

Автор: Andrey44 27.7.2009, 14:06
Цитата(MSDN)

This message scrolls the text vertically or horizontally in a multiline edit control. 

EM_LINESCROLL 
  wParam = (WPARAM) cxScroll; 
  lParam = (LPARAM) cyScroll;
Parameters
cxScroll 
Specifies the number of characters to scroll horizontally. 
cyScroll 
Specifies the number of lines to scroll vertically. 
Return Values
TRUE indicates that the message is sent to a multiline edit control. FALSE indicates that the message is sent to a single-line edit control. 

Remarks
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 the cyScroll parameter 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. 

The EM_LINESCROLL message can be used to scroll horizontally past the last character of any line. 

Requirements
OS Versions: Windows CE 1.0 and later.
Header: Windows.h.



Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)