简体   繁体   中英

C#, RichTextBox: how to implement scrolling line by line?

I have a RichTextBox in my C#-application. Both horizontal and vertical scrolling are enabled.

Current behavior: When I reach the last line of visible text area, horisontal scrolling comes to place. But scrolling is being made by pixels, not by line. So I can't see the text I'm typing becase the line itself is partly (or completely) invisible until I do vertical scrolling with arrow button or dragging vertical scrollbar.

Expected behavior: I would like to have RichTextBox scrolling similar to scrolling in Notepad. In Notepad, I always see the line I'm typing in. It is really smooth line-based scrolling.

Any idea? Some implicit settings in RichTextBox? Anything else? Thanks,

将事件处理程序添加到TextChanged事件,并以编程方式向下滚动Check out: 这篇文章位于bytes.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM