Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fastest Way to delete from Rich Text Box?

Status
Not open for further replies.

rjr9999

Programmer
Apr 7, 2001
183
US
Ok, here's the deal...text streaming into a rich text box. It seams the text box (even if there's no scroll bar) will store the ENTIRE text ammount, not just the visible portion. For speed's sake, I only want the visible portion to be shown...I tried using the MaxLength option, but that will stop text from being added to the bottom...I then tried using len() to see if it was over a certain amount, and if so, chop the top, but that made the text jump around when it happened, and slowed it up CONSIDERABLY...any other ideas on how I can go about this? Thanks.

rob
 
Try
Code:
Dim lngStart as long
dim lngEnd as long
with Rtb
    lngStart = .SelStart
    .Selstart = 9999999 ' RTB will set to real length
    lngEnd = .SelStart
    if lngEnd > 11000 then
        .selstart = 0
        .sellength = 1000
        .SelRtf = ""
        .Selstart = lngEnd
    End if
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top