Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I make this work?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00529408
Message ID:
00529412
Vues:
14
What about using a textbox with transparent background and borderstyle = 0 instead of a label?

>Before I show a form class, I am doing some positioning of the controls because of translations for multiple languages for the labels. How do I force VFP to recalculate the width of the labels after I programmatically change their captions? The following does not work.
>debugout This.lblPassword1.Width
>This.lblPassword1.Caption = This.Translate(This.lblPassword1.Caption)
>This.lblPassword2.Caption = This.Translate(This.lblPassword2.Caption)
>debugout This.lblPassword1.Width
>with This
>	lnMaxWidth = .lblPassword1.Width
>	if .lblPassword2.Visible
>		lnMaxWidth = max(lnMaxWidth, .lblPassword2.Width)
>	endif
>	.cboEmpID.Left     = .lblEmpNum.Left + .lblEmpNum.Width + 5
>	.txtPassword1.Left = .lblPassword1.Left + lnMaxWidth + 5
>	.txtPassword2.Left = .txtPassword1.Left
>	.AutoCenter = .t.
>endwith
>debugout This.lblPassword1.Width
>In all cases the DEBUGOUT returns the same value [63]. After the form shows, the actual width of the label is 74. I have also tried issuing an AutoSize on each of the labels. All fail. This is most annoying.
>
>TIA!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform