Getting to a Line in a Rich Text Box 
Author Message
 Getting to a Line in a Rich Text Box

   I'm using Zyindex to retrieve full text search hits in
a text file and want to load the searched text file into
a Rich text Box.  Zy returns to me the Line#, Hit Length,
and Hit Offset on that line.  Anyone know of a way to get
to a specific line in a rich text box?  The only access I
can see provided is through the absolute position of a
character ( ie: Character 4,685). Since the lines in the
files are varying length, I can't see any way to derive
what I need.  Any help would be appreciated.

Mark



Mon, 22 Feb 1999 03:00:00 GMT  
 Getting to a Line in a Rich Text Box

Quote:

>    I'm using Zyindex to retrieve full text search hits in
> a text file and want to load the searched text file into
> a Rich text Box.  Zy returns to me the Line#, Hit Length,
> and Hit Offset on that line.  Anyone know of a way to get
> to a specific line in a rich text box?  The only access I
> can see provided is through the absolute position of a
> character ( ie: Character 4,685). Since the lines in the
> files are varying length, I can't see any way to derive
> what I need.  Any help would be appreciated.

> Mark

Nope. The only method that applies, GetLineFromChar, requires the
absolute position of the character -- just like you said.  If you find
anything else interesting, please let me know.

--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Jeff Kilbride                 *  BE the ball!                     +
+ Potentia Technologies         *         - Chevy Chase, Caddyshack +

+*******************************************************************+
+ The Knowledge Base:  http://www.microsoft.com/kb/                 +
+ Dan Appleman's VB Programmer's Guide to the Windows (Win32) API:  +
+     http://www.mcp.com/323794211724109/zdpress/hot_titles_lo.html +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Sat, 27 Feb 1999 03:00:00 GMT  
 Getting to a Line in a Rich Text Box

Hi Mark -

        If you in the MSDN that came with VB4 pro and look at the Windows messages
that are supported by the Edit Control you will find what you need. you
should also look at the messages for the Rich Edit control. There's a LOT
there that is very useful. I think the message you want (I'm doing this
from memory now) is EM_GETLINE. Check it out...

                                                Matt



Quote:

>    I'm using Zyindex to retrieve full text search hits in
> a text file and want to load the searched text file into
> a Rich text Box.  Zy returns to me the Line#, Hit Length,
> and Hit Offset on that line.  Anyone know of a way to get
> to a specific line in a rich text box?  The only access I
> can see provided is through the absolute position of a
> character ( ie: Character 4,685). Since the lines in the
> files are varying length, I can't see any way to derive
> what I need.  Any help would be appreciated.

> Mark



Sun, 28 Feb 1999 03:00:00 GMT  
 Getting to a Line in a Rich Text Box

If you need to get to a specific line in RTB, probably the best way to
that is to use the API function SendNotifyMessage:
Declare Function SendNotifyMessage Lib "user32" Alias
"SendNotifyMessageA" (ByVal hWnd As Long, ByVal msg As Long, ByVal wParam
As Long, ByVal lParam As Long) As Long

I've done that. Call this func as follows
dummy& = SendNotifyMessage&(RichTextBox.hWnd, EM_LINESCROLL, 0&, scroll&)
 The function will scroll the specified number of lines depending on the
value of 'scroll&': if it's positive - down; negative - up.
To save you trouble:
Public Const EM_LINESCROLL = &HB6

Good luck
Anatolii

Quote:


> >    I'm using Zyindex to retrieve full text search hits in
> > a text file and want to load the searched text file into
> > a Rich text Box.  Zy returns to me the Line#, Hit Length,
> > and Hit Offset on that line.  Anyone know of a way to get
> > to a specific line in a rich text box?  The only access I
> > can see provided is through the absolute position of a
> > character ( ie: Character 4,685). Since the lines in the
> > files are varying length, I can't see any way to derive
> > what I need.  Any help would be appreciated.

> > Mark



Mon, 01 Mar 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Getting Line Text of a Rich Text Box - efficiently

2. Highlighting lines of text in a rich text box

3. Formatting Lines of Text in a Rich Text Box Control

4. getting a specific line of text from a text box (vb5)

5. Getting Data into a Rich Text Box

6. Go to specific line number - Rich Text Box

7. NEWBIE: Rich Text Box and writing to the next line

8. Rich Text Box - First line indent

9. Rich Text Box and line numbers

10. inserting lines in rich text boxes

11. Using API or other method to count number of lines in a Rich Text Box

12. New line in Rich Text Box?

 

 
Powered by phpBB® Forum Software