displaying a text box


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 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 ?
Peter Jones
Peter Jones
StrataFrame User (450 reputation)StrataFrame User (450 reputation)StrataFrame User (450 reputation)StrataFrame User (450 reputation)StrataFrame User (450 reputation)StrataFrame User (450 reputation)StrataFrame User (450 reputation)StrataFrame User (450 reputation)StrataFrame User (450 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,



Don't know if this will make any difference but try refreshing the form rather than the control.



Cheers, Peter
Edhy Rijo
E
StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K 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

Dustin Taylor
Dustin Taylor
StrataFrame Team Member (484 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
BackgroundWorkers are definately the way to go here Smile. Let us know if your un into any hickups!
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Folks. Thnaks for your contribution.

I'll read up on background workers..

Regard, Gerard

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