Click to See Complete Forum and Search --> : RichTextBox API or Method


Laurent VOISIN
September 19th, 2001, 07:24 AM
Hi,

I would to know (or select) which part of text is see by a user of my application if there is a large quatity of text in my RichTextBox.

Thanks in advance,
Laurent.

John G Duffy
September 19th, 2001, 01:11 PM
here is a simple sample that will select a certain art of a richtextbox. It will select text starting at location 10 for 100 characters

private Sub Command1_Click()
Dim X
RichTextBox1.SetFocus
RichTextBox1.SelStart = len(RichTextBox1.Text)
for X = 1 to 50
SendKeys "Add a new line " & X & vbCr
next X
DoEvents
RichTextBox1.Refresh
RichTextBox1.SelStart = 100
RichTextBox1.SelLength = 100
print len(RichTextBox1.Text)
End Sub




John G

Laurent VOISIN
September 20th, 2001, 02:03 AM
Hi,

You are right this code select a part of the text but I would to select the part that is see by the user of my application.

The goal of this question is to add color to a source in C language in my RichTextBox. But it take very long time if I work on the entire C source file. I would like to optimize and work only on the part of the code that is see by the user.

Thank anyway,
Laurent.