Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looking for a NoRefreshOnOpen
Message
 
À
08/12/2007 12:35:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01274125
Message ID:
01274198
Vues:
10
Your welcome, glad I could help.
John.

>Thanks John ... very clever. I like it!
>
>Fortunately, the "hard" part only happens once; then all forms can then start to use the new capability.
>
>Bob
>
>>Bob,
>>here is the sure but hard way to do what you want. Add a property to all text boxes, etc. sub classes that will contain data. We call it srcname. Put your controlsource there and leave the real control source empty on all objects you don't want to show info when the form loads. When you want the info to show simply loop through the objects and copy srcname to controlsource. If you add another property, we call it databox, and set it to .T. or .F. you can test that flag as you go though the form object to id which ones to copy. You can also use that flag to id what objects to remove the controlsource from if you want to.
>>Here is some sample code to try.
>>
>>
lParameters oForm
>>*
>>With oForm
>>  if upper(mForm.BaseClass) = 'FORM'
>>    .lockscreen = .t.
>>  endif
>>  * Set the form up for viewing the data
>>  * Show all fields and set the data source
>>  for each oObj in .objects
>>    With oObj
>>      if type('.DataBox') = 'L' and .DataBox
>>        .ControlSource = .SrcName
>>        .Visible = .t.
>>        .Enabled = .f.
>>      endif
>>    EndWith
>>  endfor
>>  .lockscreen = .f.
>>  .Refresh()
>>EndWith
>>
>>>When I open a particular form, the built in VFP activity refreshes all my controls. This is normally a good thing … but in this case I have controls that during their refresh, call the refresh event of other controls to complete a cascading start up logic of my own (that includes some data manipulation). What I’m looking for is the equivalent of a data session’s NoDataOnLoad so that I can set what is effectively a “NoRefreshOnOpen” for the form.
>>>
>>>If this isn’t possible, I’m willing to set a global glBlockRefresh = .t. before calling my form, and put:
>>>
if glBlockRefresh
>>>  return
>>>endif
>>>at the top of each refresh(). I would have tried it already, but I don’t know how to determine that control has returned to me so that I can then set glBlockRefresh to .f. and then programatically call appropriate refreshes to get things going. That is, where would I put glBlockRefresh = .f. I’m assuming that it’s at the top of the form’s Init, but I’m not sure.
>>>
>>>Any ideas on a NoRefreshOnOpen (or equivalent)?
>>>
>>>Bob
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform