Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Center label
Message
De
13/08/2001 13:55:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Center label
Divers
Thread ID:
00543150
Message ID:
00543150
Vues:
49
Hi,

I'm using vfp 5. There is no auto-center property for labels. So this is what I have done in the init method of the form:
lparameter tcCompany

with thisform
	.lblTitle.caption = .lblTitle.caption  + tcCompany
	.lblTitle.left = (.width - .lblTitle.width)/2
endwith
the lblTitle.caption already has a value in it from design time. In run time, the lblTitle is appended to. The problem is with setting the lblTitle.left property. auto-size for the label is set to true. Anyways, it seems to be getting the old lbltitle.width, before the caption was appended to. If I put .lblTitle.left = (.width - .lblTitle.width)/2 into the click event of a command button it works. It just doesn't seem to work in the init event of the form. the Any ideas? I tried setting .lblTitle.width = .lblTitle.width + len(tcCompany), but a string of say four characters is not equal to the width of four charactors so it didn't work out.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform