|
-
February 4th, 2000, 11:27 AM
#1
save / jump to scroll position in a richtextbox
i'm developing an editor control in VB6 based on a rich text box which syntax highlightd for a programming language. my highlighting subroutine actually inserts the RTF code and replaces the .textRTF property every time it is run.
the trouble is, this routine sets the cursor position to 1 and scrolls up to the top of the box every time, and i just want it to appear to the user that the contents were colorized, and no scrolling took place.
is there a way to (possibly using the API):
- suspend refresh
- save the number of the first line visible in the rtbox
- EXECUTE MY HIGHLIGHTING SUBROUTINE
- jump back to that line number
- resume refresh
so that the highlighting looks smooth?
-
February 4th, 2000, 11:46 AM
#2
Re: save / jump to scroll position in a richtextbox
>is there a way to (possibly using the API):
> suspend refresh
LockWindowUpdate API
>- save the number of the first line visible in the rtbox
Sendmessage(...EM_GETFIRSTVISIBLELINE...)
>- jump back to that line number
SendMessage(...EM_SETSEL...)
>- resume refresh
LockWindowUpdate again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|