Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stubborn Caption Placement ! part 2
Message
 
À
19/12/2015 07:53:23
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:
01629121
Message ID:
01629189
Vues:
37
>>Questiion....
>>
>>This is related to my previous question...."Stubborn Caption Placement !"
>>
>>I created an empty FORM and placed this in the INIT, and created two label controls on the form,
>>
>>lblTesting and lblWidth
>>
>>and ran the code
>>
>>The Width of the lblTesting starts at 60, and ends at 60 !!! It does not get larger!!! Why is that???????
>>
>>
>>
>>Thisform.lblTesting.Caption = 'ONE'
>>ThisForm.lblTesting.Refresh
>>Thisform.lblWidth.Caption = ALLTRIM(STR(Thisform.lblTesting.Width))
>>
>>Thisform.lblTesting.Caption = 'ONE TWO'
>>ThisForm.lblTesting.Refresh
>>Thisform.lblWidth.Caption = ALLTRIM(STR(Thisform.lblTesting.Width))
>>
>>Thisform.lblTesting.Caption = 'ONE TWO THREE'
>>ThisForm.lblTesting.Refresh
>>Thisform.lblWidth.Caption = ALLTRIM(STR(Thisform.lblTesting.Width))
>>
>>Thisform.lblTesting.Caption = 'ONE TWO THREE FOUR'
>>ThisForm.lblTesting.Refresh
>>Thisform.lblWidth.Caption = ALLTRIM(STR(Thisform.lblTesting.Width))
>>
>>Thisform.lblTesting.Caption = 'ONE TWO THREE FOUR FIVE'
>>ThisForm.lblTesting.Refresh
>>Thisform.lblWidth.Caption = ALLTRIM(STR(Thisform.lblTesting.Width))
>>
>>
>>Thanks!
>
>Is AutoSize set to ,T, for the label? It needs to be.
>
>Tamar

Yes it is.

I had to use Greg Green's suggestion with the TextWidth of the form to get it to work.... like this....
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