RichTextBox blinks when appending text 
Author Message
 RichTextBox blinks when appending text

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



Sat, 12 Apr 2003 03:00:00 GMT  
 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



Sat, 12 Apr 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Text Blinking in RichtextBox?

2. RichTextBox Re-Writes RTF wrong when appending text

3. RichTextBox Re-Writes RTF wrong when appending text

4. append text to richtextbox question

5. Appending text in RichTextBox VB6 control problem

6. RichTextBox Re-Writes RTF wrong when appending text

7. RichTextBox Re-Writes RTF wrong when appending text

8. BLink blink blink

9. RichTextBox Control "Blinking"

10. appending a richtextbox with 3 files

11. Appending text in a text box

12. How can I append a line of text to the start of a 100MB text file

 

 
Powered by phpBB® Forum Software