Label and ProgressBar refresh problem

Hi All,

I have a conversion program which reads in about 20 tables from an old database and write to a new one. Tables are converted one by one in separate methods. On the screen, I have 20 corresponding pairs of Labels (to show the number of converted records) and ProgressBars (show percentage) to show the conversion progress of each table. If I convert them one at a time, the ProgressBar and the Label shows correct values (moves from left to right until finish), however, if I convert 20 tables all in a time (still one by one), all Labels do not refresh and the values for the ProgressBars are all wrong. Until the whole conversion finishes, all Labels and ProgressBars refresh with correct values.

Should I need to add timer, will this slow down the conversion time?



are you issuing a .INVALIDATE after you change the labels content?

Yes, .refresh helps to refresh the Labels (invalidate has no effect) but the progress bars’ values are still not correct. Another problem is, the application stops responding in the middle of the conversion process until it completes. Labels refreshing stop when the app stops responding.

Possible idea:

Most of the plugins yield to the UI so that they can be used in a thread.
Put your update / conversion code into threads.
Put a timer on the window.
In the timer event, query the number of records in the table and display that?

rs = thesdb.SQLSelect("select count1) numrecords from newtable") label1.text = rs.field("numrecs").stringvalue