Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I make this work?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How do I make this work?
Miscellaneous
Thread ID:
00529408
Message ID:
00529408
Views:
39
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!
Mark McCasland
Midlothian, TX USA
Next
Reply
Map
View

Click here to load this message in the networking platform