Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Putting the cursor at the end of a textbox
Message
From
04/01/2005 17:46:51
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Putting the cursor at the end of a textbox
Miscellaneous
Thread ID:
00974216
Message ID:
00974216
Views:
51
I have a textbox defined with multiline. It is used for showing the log of a process. As it becomes long, the scrollbar will appear. If I only append text to the control, the cursor will remain at the top so I will not see the actual log process of the last lines being added. So, I did this when I add some text:
        LogWebServer.SelectionStart = LogWebServer.Text.Length
        LogWebServer.ScrollToCaret()
This put the cursor at the end of the textbox. It then scroll the content at the bottom. I can then see the recent text being added.

However, this is causing a bug which freezes the application from time to time. It is easily reproducable when I don't comment those lines. Is there a better way to put the visual content at the bottom to be visual which might not cause the freeze bug to happen?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Reply
Map
View

Click here to load this message in the networking platform