Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > API > Making the RichTextBox scroll back..


Reply
 
Thread Tools Display Modes
  #1  
Old 01-25-2001, 01:58 PM
Tyger
Guest
 
Posts: n/a
Question Making the RichTextBox scroll back..


When you change the TextRTF property of the Rich TextBox Control, it moves the cursor to the beginning and scrolls to there. I know I can set SelStart and SelLength to move it back, but I also want it to be scrolled to the same position as it was. I tried sending the EM_LINESCROLL message to the Rich TextBox, but it keeps scrolling all the way to the bottom, so that the last line is the only visible line at the top. (By the way, I'm using the EM_GETFIRSTVISIBLELINE message to get the position I'm at in the beginning..) For example, If I want it to scroll down 40 lines and it's currently at line 0, it still goes all the way down to line 141.

Here's the line of code I'm trying to use to send the message:
SendMessage(RText.hWnd, EM_LINESCROLL, 0, TopLine)

At this point, it's scrolled all the way up. I set TopLine to 40 just to test it out. There are 141 lines, and that's how far down it ends up going.. By the way, TopLine is a Long.

Why does EM_LINESCROLL keep moving it to the bottom like that? Also, is there a better way of doing this?

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->