Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2005

Tip: Looking for answers? Try searching our database.

2 Simple Questions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matthew MacDonald - 21 Jan 2005 02:37 GMT
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
Morten Wennevik - 21 Jan 2005 08:19 GMT
Hi Matthew,

> Hi everyone,
>   I have what I think are 2 pretty simple questions.  I know I have done  
[quoted text clipped - 8 lines]
> 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.

> Thanks all in advance,

NP

> Matt

Signature

Happy Coding!
Morten Wennevik [C# MVP]

Matthew MacDonald - 21 Jan 2005 12:56 GMT
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
> Hi Matthew,
>
[quoted text clipped - 26 lines]
>
> > Matt

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.