TextBox FLICKER

G

Guest

Could someone point me to a solution
I am appending text to bottom of a textbox and would like the display to scroll to the bottom where the new text is instead of the top of the textbox.
I know the following solution but the issue with this is the FLICKER
Any solution

textBox1.AppendText("This is a test string \n")
textBox1.SelectionStart = textBox1.Text.Length
textBox1.ScrollToCaret()

thank
Abdullah
 
S

Sahil Malik

Try creating your own control inherited from the textbox, and then set
DoubleBuffering on in it. (Using the SetStyle method in it's constructor).

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/



Abdullah said:
Could someone point me to a solution?
I am appending text to bottom of a textbox and would like the display to
scroll to the bottom where the new text is instead of the top of the
textbox.
 
A

AlexS

Hi, Abdullah

You can use also BeginUpdate/EndUpdate around code, which causes flicker.
Did you try this?

HTH
Alex

Abdullah said:
Could someone point me to a solution?
I am appending text to bottom of a textbox and would like the display to
scroll to the bottom where the new text is instead of the top of the
textbox.
 
G

Guest

Alex,
The TextBox control does not have a BeginUpdate/EndUpdate.

Thanks
Abdullah

----- AlexS wrote: -----

Hi, Abdullah

You can use also BeginUpdate/EndUpdate around code, which causes flicker.
Did you try this?

HTH
Alex

Abdullah said:
Could someone point me to a solution?
I am appending text to bottom of a textbox and would like the display to
scroll to the bottom where the new text is instead of the top of the
textbox.
 
G

Guest

Does not help at all. Plus I think the control is already double buffered

Abdulla

----- Sahil Malik wrote: ----

Try creating your own control inherited from the textbox, and then se
DoubleBuffering on in it. (Using the SetStyle method in it's constructor)

- Sahil Mali
Independent Consultan
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik



Abdullah said:
Could someone point me to a solution
I am appending text to bottom of a textbox and would like the display t
scroll to the bottom where the new text is instead of the top of th
textbox
 
J

Justin Rogers

Please post a complete sample of what you are doing (so we have the same
properties)
and we can run that and see the flicker for ourselves. Once we have that we can
help
you better. Should be a single code file, we can compile from the command line
and
easily run. Maybe have a button that we can click to perform the action below.

First off, you are scrolling the textbox, and displaying new text.
Psychologically when
a screen changes it always appears to *flicker*. However, if the flicker you
are describing
is more than just the standard flicker associated with quickly changing a
textual area, then
we can actually help you. Otherwise you'll just have to live with it, or write
some code that
behaves differently than the standard text box is capable of.


--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

Abdullah said:
Could someone point me to a solution?
I am appending text to bottom of a textbox and would like the display to
scroll to the bottom where the new text is instead of the top of the textbox.
 
A

AlexS

Abdullah,

once again: take a look at BeginUpdate/EndUpdate. Yes, methods do not exist
for text box - nobody expected long / frequent updates there, But
WM_SETREDRAW, which is used in methods to achieve the goal is available,You
can use SendMessage API, for example.

HTH
Alex
 

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

Top