TRihEdit и Scrolling
6 отговора
144 прегледа
TRihEdit и Scrolling
Как да накарам един RichEdit да се скрол-не някъде? Със метода ScrollBy не се получава желания резултат, а един от двата (извънредно неудачни) начина, за които се сещам е да Insert ред там, където искам да се скролира, и после да го изтрия. Може ли да стане по друг начин?
Re: TRihEdit и Scrolling
SetScrollPos...
Не всичко което виси е Windows, но той най-често го прави
Не всичко което виси е Windows, но той най-често го прави
Tsk - sys SetScrollPos i SetScrollInfo ne stava
Тези функции [SetScrollPos и SetScrollInfo] само препозиционират скрол бара и опционално го прерисуват на новата позиция, което обаче не се отразява на съдържанието на RichEdit контрола. Защо ли?
-------------
Искам да знам какво мисли Бог - останалото са подробности. (Einstein)
-------------
Искам да знам какво мисли Бог - останалото са подробности. (Einstein)
Re: Tsk - sys SetScrollPos i SetScrollInfo ne stava
probwaj towa po dolo az winagi sam iskal da go probwam ma se ne mi e ostawalo wreme ako raboti kaji da znaem.
MSDN:
---------
EM_SCROLL
The EM_SCROLL message scrolls the text vertically in a multiline edit control. This message is equivalent to sending a WM_VSCROLL message to the edit control. You can send this message to either an edit control or a rich edit control.
To send this message, call the SendMessage function with the following parameters.
SendMessage(
(HWND) hWnd, // handle to destination window
EM_SCROLL, // message to send
(WPARAM) wParam, // scroll action
(LPARAM) lParam // not used; must be zero
);
Parameters
wParam
Specifies the action the scroll bar is to take. This parameter can be one of the following values. Value Meaning
SB_LINEDOWN Scrolls down one line.
SB_LINEUP Scrolls up one line.
SB_PAGEDOWN Scrolls down one page.
SB_PAGEUP Scrolls up one page.
lParam
This parameter is not used.
Return Values
If the message is successful, the high-order word of the return value is TRUE, and the low-order word is the number of lines that the command scrolls. The number returned may not be the same as the actual number of lines scrolled if the scrolling moves to the beginning or the end of the text. If the wParam parameter specifies an invalid value, the return value is FALSE.
------------------------------
I got a COMPILER, and I'm not afraid to use it!
MSDN:
---------
EM_SCROLL
The EM_SCROLL message scrolls the text vertically in a multiline edit control. This message is equivalent to sending a WM_VSCROLL message to the edit control. You can send this message to either an edit control or a rich edit control.
To send this message, call the SendMessage function with the following parameters.
SendMessage(
(HWND) hWnd, // handle to destination window
EM_SCROLL, // message to send
(WPARAM) wParam, // scroll action
(LPARAM) lParam // not used; must be zero
);
Parameters
wParam
Specifies the action the scroll bar is to take. This parameter can be one of the following values. Value Meaning
SB_LINEDOWN Scrolls down one line.
SB_LINEUP Scrolls up one line.
SB_PAGEDOWN Scrolls down one page.
SB_PAGEUP Scrolls up one page.
lParam
This parameter is not used.
Return Values
If the message is successful, the high-order word of the return value is TRUE, and the low-order word is the number of lines that the command scrolls. The number returned may not be the same as the actual number of lines scrolled if the scrolling moves to the beginning or the end of the text. If the wParam parameter specifies an invalid value, the return value is FALSE.
------------------------------
I got a COMPILER, and I'm not afraid to use it!
Re: Tsk - sys SetScrollPos i SetScrollInfo ne stava
Bachka da. Az tochno s nego sum go pravil, no ne mojeh da se setq kak beshe tochno, nqmam source-a pred men. Tova e mai nai-doroto reshenie. Polzvam go veche 2-3 meseca v programa i nqma problemi.
by Waz Gaa
[email protected]
by Waz Gaa
[email protected]
EM_SCROLL - OK!
SendMessage(RichEdit1.Handle, EM_SCROLL, SB_TOP, 0); // работи като пич :)
-------------
Искам да знам какво мисли Бог - останалото са подробности. (Einstein)
-------------
Искам да знам какво мисли Бог - останалото са подробности. (Einstein)