Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox.value refreshes very inconsistently
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Textbox.value refreshes very inconsistently
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01041129
Message ID:
01041129
Vues:
53
Hi all:

This is driving me batty, and I haven't found any good references to others having or solving the problem.

I have a simple little program that processes some Excel and text files and does something with the data.

To let the users know what's happening I have a "progress" textbox, and a "status" textbox in a form, which tells them "what I'm doing now" and "where are we in the process". Throughout the process, I change the .value of the textboxes to reflect the progress and status. Only, in fact the screen refreshes very inconsistently. I've even taken to running subroutines called "status_refresh" and "progress_refresh" after each time I have changed the textbox.value which have code like this:

_vfp.AutoYield=0
mywindow_process.LockScreen=.T.
mywindow_process.status_text.refresh
mywindow_process.status_text.SetFocus()
mywindow_process.refresh
mywindow_process.LockScreen=.F.
_vfp.AutoYield=1

Supposedly I wouldn't need ANY of that, or at the most a .refresh for the textbox, but even with the above code the textbox only gets refreshed some of the times I change the value!

After struggling with this, out of desperation, I just now removed some semicolons in the lines where I was changing the value of the textbox -- they used to say things like

statustext = statustext + CHR(13) + CHR(10) + ;
"There are " + ALLTRIM(STR(excel_filecount)) + " Excel files to be read"
mywindow_process.status_text.value = statustext

and now the reassignment of the statustext is all on one line. Aha! Sort of. Removing all the semicolon (continued) lines makes more of the updates work, but not all. Some of them half-work -- part of the new value shows up, but not all... it cuts off in the middle of words, for example, the above might show up in my screen as: "There are 3 Excel fi"


Argh! This should be such a simple thing! Seems like textbox is a decent way to do what I'm doing, because sometimes I directly add to the value like this:

mywindow_process.status_text.value = mywindow_process.status_text.value + " something temporary I want to show..."

and sometimes I want to throw out the change shown by the above and make a "permanent" change like this:

statustext = statustext + " something I want to remain on the screen for the rest of the process..."
mywindow_process.status_text.value = statustext

and the process may read a bunch of files and do a bunch of things, and I want the user to be able to scroll back through the progress and status textboxes if they need too...

Help?

Thanks!

Kevin Atkins
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform