|
Scrolling Text in an Edit Control
An application can implement scrolling in an edit control by using the
automatic scrolling styles discussed in Edit Control Styles or by explicitly adding scroll bars to the control. To add a horizontal
scroll bar, use the style WS_HSCROLL; to add a vertical scroll bar, use the style
WS_VSCROLL. An edit control with scroll bars processes its own scroll bar
messages. For detailed information about adding scroll bars to edit controls, see Scroll Bars.
Windows provides three messages that an application can send to an edit
control with scroll bars. The EM_LINESCROLL message can scroll a multiline edit control both vertically and horizontally.
The lParam parameter specifies the number of lines to scroll vertically starting from
the current line and the wParam parameter specifies the number of characters to scroll horizontally, starting
from the current character. The edit control doesn't acknowledge horizontal
scrolling messages if it has the ES_CENTER or ES_RIGHT style. This message
applies to multiline edit controls only.
The EM_SCROLL message scrolls a multiline edit control vertically, which is the same effect
as sending a WM_VSCROLL message. The wParam parameter specifies the scrolling action. The EM_SCROLL message applies to
multiline edit controls only.
The EM_SCROLLCARET message scrolls the caret into view in an edit control. This was done in
previous versions of Windows by specifying wParam = FALSE in an EM_SETSEL message. A Win32-based application should use the EM_SCROLLCARET message for
the task.
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
More Online Helps
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|