2 Simple Questions

  • Thread starter Thread starter Matthew MacDonald
  • Start date Start date
M

Matthew MacDonald

Hi everyone,
I have what I think are 2 pretty simple questions. I know I have done it
before, but can't remember how I did it.

#1: I have a windows form with a textbox. The textbox is getting filled
from within a function. I need to have the scroll buttons on the text box
accessable at all times, not just when the loop that fills it gets back
around to the application.doevents line. I'm pretty sure there is an easy
way to do this with threading.

#2: This one is really dumb, but I'm having a slow day. How can I get the
text box to autoscroll to the bottom everytime & add text dynamically to it?

Thanks all in advance,

Matt
 
Hi Matthew,

Hi everyone,
I have what I think are 2 pretty simple questions. I know I have done
it
before, but can't remember how I did it.

#1: I have a windows form with a textbox. The textbox is getting filled
from within a function. I need to have the scroll buttons on the text
box
accessable at all times, not just when the loop that fills it gets back
around to the application.doevents line. I'm pretty sure there is an
easy
way to do this with threading.

Possibly, or you could call Application.DoEvents() more often.
#2: This one is really dumb, but I'm having a slow day. How can I get
the
text box to autoscroll to the bottom everytime & add text dynamically to
it?

Use SelectionStart to place your caret and TextBox.ScrollToCaret() to move
the ScrollBar.
 
The fix for #2 that you suggest works fine, thanks.

The problem with application.doevents is that I am calling it on every
iteration of my loop, but the statement in the body of the loop (a wmi call
to a remote system) takes so long to process, that it still doesn't make the
scrolling fluid, you still have to wait for the loop to get around to
process the scroll event. Any other ideas?

Thanks again,
Matt
 
Back
Top