Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AutoSize property doesn't work correctly
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00564449
Message ID:
00564559
Vues:
14
Did setting Label's Visible property resolved this problem?

>Hi everybody,
>
>I have a class with a label, which I'm trying to set as AutoSize = .t. This label may change caption in the live of the form. I have a special method ChangeCaption with these lines:
>
>********************************************************************
>* 11/26/99: NN created this method for handle Transactions vs. Property type of query
>lparameters new_caption		&& takes 1 required argument
>with this
>	if .label1.caption <> m.new_caption
>    	.label1.AutoSize = .f.
>		.label1.caption= m.new_caption
>		.label1.AutoSize = .t.
>		.ResizedAlready = .f.
>		.resize()
>	endif
>endwith
>
>I've added AutoSize switching back and forth, but it didn't solve the problem.
>
>Here is my ValRange class Resize code:
>
>* BTCC_ValRange.Resize: event triggered when this container's size is altered
>with this
>	if !.ResizedAlready
>        .text1.width= (.width - .label1.width - .label2.width -16)/2
>* let width of text1 determine that of text2
>   		.text2.width = .text1.width
>		.label1.left = 0
>        .text1.left = .label1.width + 2
>* put hyphen a little to the right of text1
>		.label2.left = .text1.left + .text1.width + 2		
>		 .text2.left = .label2.left + .label2.width + 1
>		.ResizedAlready=.t.
>	endif
>endwith
>
>If I run the form, these controls are not properly showed. Some of them have text1 overlapped label1, some of them in opposite have too much space between label and text1.
>
>May be I have to calculate width of this label by myself and set it?
>
>Could you please help me here?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform