displaying a text box


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I know this should be simple enough ...I am looping through a table and want to show the count as I am looping through. So I have  txtBox.text= myCount;  txtBox.refresh(); This shows the counter initially ok but if I click off the form and back on it for any reason, the number in the text box stops refreshing, even though the loop continues ok. Is there something I need to do to keep the textbox refreshing ?
Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Gerard O Carroll (04/19/2010)
Is there something I need to do to keep the textbox refreshing ?




Hi Gerard,



Yes, you can use a BackgroundWorker to update the textbox. Basically the problem is that you are using the form's thread to update the textbox from the loop and if you move out of the form, that thread will not continue to refresh the textbox, you need to use a separate thread to do that.



The BackgroundWorker is pretty easy to use and there are lot of samples in Google on how to use it.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search