Article View: it.comp.lang.visual-basic
Article #1PROBLEM WITH RICHTEXT BOX -- NEED TO SCROLL DURING RUNTIME USING CODE.
From: Chetan Phull
Date: Thu, 13 Aug 1998 00:00
Date: Thu, 13 Aug 1998 00:00
25 lines
1943 bytes
1943 bytes
Hello people,
Here's my situation: I have a RichTextBox and I wrote code so
that when you click on it it'll highlight the line that was clicked
on. Along with this I want the RTB to scroll so that the sellected
line will be in the middle of the RTB. This is the API that'll scroll
the selected line:
Dim Ret As Long
Ret& = SendMessage(rtbWaves.hwnd, EM_SCROLL, 1, 0)
If Ret = 0 Then MsgBox ("Can't send message to rtbWaves")
I just put in any two numbers as the last two parameters in the
SendMessage API to experiment. What I want is to make the text in the
RTB shift so that the highlighted line will be in the middle of the
RTB.
Here's an idea I had, calculate the position of the hilighted line
relative to what you can see. (meaning a line may be the 50th line in
the text but from what you can see in the RTB, it's the 3rd line).
And then scroll the RTB so that the line is now the 8th line from the
top (which would make it the middle line cuz there are 17 lines you
can see in the RTB.)
thanks,
Chetan
Technical Details
Message-ID:
<35d447cd.23876692@nntp.interlog.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10b997,f8e15e9a5922ff9d,start X-Google-Attributes: gid10b997,public X-Google-Thread: 10f2ee,f8e15e9a5922ff9d,start X-Google-Attributes: gid10f2ee,public X-Google-Thread: fb992,f8e15e9a5922ff9d,start X-Google-Attributes: gidfb992,public X-Google-Thread: 1286ed,f8e15e9a5922ff9d,start X-Google-Attributes: gid1286ed,public From: phull@interlog.com (Chetan Phull) Subject: PROBLEM WITH RICHTEXT BOX -- NEED TO SCROLL DURING RUNTIME USING CODE. Date: 1998/08/13 Message-ID: <35d447cd.23876692@nntp.interlog.com> X-Deja-AN: 380863703 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii NNTP-Posting-Time: 13 Aug 1998 20:09:19 GMT Organization: Trulogic Systems Inc. Mime-Version: 1.0 Newsgroups: it.comp.lang.visual-basic,no.it.programming.visual-basic,comp.lang.visual.basic,ab.software.developers