ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
How do you make a textbok automatically scroll down? (Bots)
How do you make a textbok automatically scroll down? // BotsbarbarossaMay 11, 2001, 9:43pm
To: All Avid Users Of AW:
This may sound like a stupid question, but how do you make a textbox to automatically scroll down when more text is added to it? Owner of the K bot, Barbarossa 315942 tony mMay 11, 2001, 10:22pm
Erg! Barbarossa, I had the code to do this once... gimme an hour, and
I'll email you if I remember it. [View Quote] brantMay 11, 2001, 11:38pm
If perchance, Tony didn't get you the code, it's pretty simple. Just
say something like: Text1.SelStart = Len(Text1.Text) The SelStart property sets the starting point of the selected text in the text box, or the cursor position if no text is selected. The code above moves the cursor to the last letter of the text box. moriaMay 12, 2001, 5:00am
Just an additional thing here..
Make sure you have set the box to have scrollbars on it, otherwise I think you will go to the end of the text but you wont see it, because the text box will fill up from the top and the selstart/ seltext will put you beyond the visible area if you have a lot of text accumulating there:) I prefer, rather than using text boxes to use the RTF control.. okay so its another control to compile, but you can do a lot more with RTF controls for editing etc that with a plain text box, but the selstart/seltext thing works with RTF as well. Moria [View Quote] tony mMay 12, 2001, 5:04am
xelagMay 12, 2001, 8:28am
Text boxes have a very low capacity and were causing me errors, I use RTF
controls. You need to periodically remove the first strings anyway. XelaG [View Quote] grimbleMay 12, 2001, 9:08am
xelagMay 12, 2001, 6:15pm
MaxLines := ChatLines + 100;
if (RichEdit .Lines.Count > MaxLines) then while (RichEdit .Lines.Count > ChatLines) and (RichEdit .Lines.Count > 0) do RichEdit .Lines.Delete(0); in Pascal :) I delete 100 lines at one go, as you see... ChatLines is a fixed maximum (say 500), but I allow 100 more. When it passes that, I chop of to reduce the number of lines to Chatlines. XelaG [View Quote] |