Multiline TextBox scrollbar moving up and down on updates

  • Thread starter Thread starter Avi
  • Start date Start date
A

Avi

Hi all,

I have a web page with Multiline TextBox. Every 3 seconds I refresh the
page and display all received messages in this TextBox. When the TextBox is
updated (The Text property is set). The vertical scrollbar is flickering
(moving up and down and the scrollbar "square" is starting big and shrinks
when the TextBox is filled). Please note that every refresh more data is
added to the TextBox, and nothing is taken out (Appending new lines to the
existing ones).

How can I avoid this behavior?

Thanks,
Avi
 
Not to insult your coding skills, but I would check the code you use to set
the Text property. Do you append each message individually, or concatenate
them into a string variable that gets assigned to the Text property? You may
also want to try setting the Text property to String.Empty at the beginning
of your code. Something else that you may want to look into, if you haven't
already, is UpdatePanels from ASP.NET AJAX, if you are only updating the one
Textbox and you are doing it every 3 seconds this could greatly improve the
efficiency of your page, and they are very easy to use. Hopefully some of
this helps.
 
Thanks,

Yes, I have a string varialbe with all the messages. I did not use an
update panel since the TextBox is the only object on my page.

Nathan , I did not understand how setting the Text property to String.Empty
would help.
 
I believe it would help if you showed me your code, sometimes the problem is
something little that you just miss (don't be embarrassed, we all miss
little things that we want to smack ourselves in the face for). Sometimes
the steps we are taking is hard to put into words.
 
Back
Top