Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stubborn Caption Placement !
Message
 
À
18/12/2015 16:04:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01629113
Message ID:
01629190
Vues:
84
>I had the same problem as you -- seems the length does not get updated when the caption is changed. Even if the autosize property is set to true. You can use the form's TextWidth() method to return the length; just ensure the form's fontsize, fontname properties are the same as the label.

Thanks!

This is how I implemented it in my code!
IF Thisform.m_seek(ALLTRIM(tcRx) + ALLTRIM(tcRefill) + "1","rx_claim","fullerx",1)   && seeking to see if there is a TP claim record
		Thisform.lblRx.Caption = ALLTRIM(tcRx) + "-" + ALLTRIM(tcRefill) + translatewrd("  Previously billed to")

		Thisform.m_seek(rx_claim.plan_id,"plan_search","plan_id",1)   && seeking in third_party_plans table to get TP name
		Thisform.lblIns1.Caption = "Primary: " + ALLTRIM(plan_search.plan_name)
		lnFirstTPP = rx_claim.plan_id
		Thisform.FontName = Thisform.lblIns1.FontName
		Thisform.FontSize = Thisform.lblIns1.FontSize
		
		lnWidth = Thisform.TextWidth(Thisform.lblIns1.Caption) + 20

*TMT 12/18/2015 Case# 110829 - Display the associated cardholder_id_no along with the third Party Plan
		IF SEEK(PADL(rx_claim.patient_id,5,"0")+PADL(rx_claim.plan_id,4,"0")+PADL(rx_claim.tp_order,2,"0"),"patient_third_party","plan_patnt")
			Thisform.lblPrimaryCardholderID.Caption = " / " + ALLTRIM(patient_third_party.cardholder_id_no)
			Thisform.lblPrimaryCardholderID.Left = Thisform.lblIns1.Left + lnWidth 
		ENDIF 
	
		*-- now check to see if there is another TPP for this refill
		IF Thisform.m_seek(ALLTRIM(tcRx) + ALLTRIM(tcRefill) + "2","rx_claim","fullerx",1)   && seeking to see if there is a TP claim record
			Thisform.m_seek(rx_claim.plan_id,"plan_search","plan_id",1)   && seeking in third_party_plans table to get TP name
			Thisform.lblIns2.Caption = "Secondary: " + ALLTRIM(plan_search.plan_name)
			lnSecondTPP = rx_claim.plan_id
			Thisform.FontName = Thisform.lblIns2.FontName
			Thisform.FontSize = Thisform.lblIns2.FontSize

			lnWidth = Thisform.TextWidth(Thisform.lblIns2.Caption) + 20

*TMT 12/18/2015 Case# 110829 - Display the associated cardholder_id_no along with the third Party Plan
			IF SEEK(PADL(rx_claim.patient_id,5,"0")+PADL(rx_claim.plan_id,4,"0")+PADL(rx_claim.tp_order,2,"0"),"patient_third_party","plan_patnt")
				Thisform.lblSecondaryCardholderID.Caption = " / " + ALLTRIM(patient_third_party.cardholder_id_no)
				Thisform.lblSecondaryCardholderID.Left = Thisform.lblIns2.Left + lnWidth 
			ENDIF 
		ELSE
			Thisform.lblIns2.Caption = ""
			Thisform.lblSecondaryCardholderID.Caption = ''
		ENDIF
		
So, I had to make sure the Forms text and size were the same as the text that I wanted to get the width for. Once I had the width, I was home free.

Thanks!
Tommy Tillman A+ NetWork+ MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform