Multiline TextBox scrollbar moving up and down on updates

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
 
N

Nathan Sokalski

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.
 
A

Avi

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.
 
N

Nathan Sokalski

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top