
RichTextBox blinks when appending text
How are you appending the text?
If you're using:
RichTextBox1.Text = RichTextBox1.Text & NewText 'Replaces entire contents
each time (flash)
Use:
With RichTextBox1
.SelStart = Len(.Text)
.SelText = NewText 'Just append new text... no flash.
End With
For Q2, the RichTextBox1 has a MaxLength property that you can set.
For Q3, you may be able to use the GetLineFromChar Method.
Quote:
> Hi,
> I am using RichTextBox in a chat type of application. I have the
> following 3 questions:
> 1) When I append text to RichTextBox (a multiline), I can see some
> blinking going on in the window, when the text gets appended. Should
> I use UpdateLockWindow? Is that what people do typically for
> application using RichTextBox? I am afraid that it might be
> inefficient as there will be continously appending text because of
> the nature of application (chat). Any good solution?
> 2) I have another single line RichTextBox, how can I limit the number
> of charcters that a user can type in it? e.g ser can not type more
> then 80 to 100 characters??
> 3) How can I limit the number of lines in a multiline RichTextBox? so
> that it lines exceed that number, I can cler all the rest of the
> lines?
> I would realy appreciate any tips/hints on the above. It will be great,
> if you can email me your response. Thanks in advance.
> Shri