Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Elusive dimensions of autosized labels
Message
De
29/11/2003 19:48:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00854506
Message ID:
00854507
Vues:
33
>It seems that that the height and width properties of autosized labels are elusive values in the midst of updating several controls on a form. For example, if you set the label's caption, and then set autosize to true, the height and width properties don't always immediately reflect what the newly autosized height and width are. It's as if they simply aren't calculated until later, sometimes even when a wait state is imposed such as inkey(.05). This is really a hassle when you need those values _right_then_ in order to place other controls relative to the label within the same thread of code. Thanks very much for any suggestions.

I am not sure, but you may try to force a "recalculation" with commands similar to this:
with ThisForm.LblSomeMessage
  .Caption = "Some caption"
  .AutoSize = .F.
  .AutoSize = .T.
  MessageBox(transform(.Width)) && or some other command that uses the .Width property
endwith
See if it works at all. The second command might be optional. I suspect your problems appear only if you keep the .AutoSize property at .T. all the time - and trust any updating to be automatic and immediate.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform