AutoScroll EM_LINESCROLL Demo
This small very fast code demonstrates the use of EM_LINESCROLL (sendmessage api)to to automatically, instantly, precisely, and simultaneously scroll 1 or several RichText, Text box, or List boxes. If you build chat interfaces, or are building a code editor... this code is for you! Even the rankest beginner will be able to understand and use this code in minutes. There's more comments than code! I got the idea while using KRYO_11's external scroll bar code (found here on PSC). His code uses the EM_SCROLL message and a for/next loop that works fine for small text boxes... but goes a little nutty when the text box is tall and there are many lines to scroll. The EM_LINESCROLL message does not "Scroll" to the new position... it jumps there similar to the GoTo statement in VB. It is VERY FAST! I needed this yesterday... but couldn't find it anywhere... even a text search of PSC's code returned only one instance of a chat bot that didn't appear to really use the EM_LINESCROLL message... so if there is ANY similar code on PSC, it is well hidden indeed! The project contains 2 demos: 1) Compares the EM_SCROLL and EM_LINESCROLL messages and speed of their use. 2) This demo simultaneously scrolls several RTBs, a text box and a list box from 1 regular old VB scrollbar. It will also teach you how to sync up the objects so they not only scroll together... but scroll the right lines together... and quickly. Hope You Enjoy The Code! CptnVic
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Upload