Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Glen Villar
  Where is Glen Villar?
 Palayan City
 Philippines
 Glen Villar
 To: Hans Leander
  Where is Hans Leander?
 Cleveland
 Ohio - United States
 Hans Leander
 Tags
Subject: RE: Label width always 40
Thread ID: 394154 Message ID: 394156 # Views: 53 # Ratings: 3
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Tuesday, December 31, 2013 3:33:11 AM         
   


> I can't get labels to center over grids.
>
> I have the following code in a form's Init method:
>
>
.lblAddresses.Left = .grdAddresses.Left + (.grdAddresses.Width - .lblAddresses.Width)/2

>
> The equation works, and would give the correct result if it was not for the fact that, regardless of label, the label width is equal to 40 (in one case, it is actually 450).
>
> Any idea why this is happening? The correct width of the label should be "known" by the time I use it in the form's Init method!?
>
> Regards,
>
> Hans L

Just a guess, it's maybe the autosize property of the label? Must be set to .T.




My blog: http://thereportersassistant.blogspot.com

ENTIRE THREAD

Label width always 40 Posted by Hans Leander @ 12/31/2013 3:09:21 AM
RE: Label width always 40 Posted by Glen Villar @ 12/31/2013 3:33:11 AM
RE: Label width always 40 Posted by Hans Leander @ 12/31/2013 4:13:25 AM
RE: Label width always 40 Posted by Vilhelm-Ion Praisach @ 12/31/2013 3:42:44 AM
RE: Label width always 40 Posted by Hans Leander @ 12/31/2013 4:14:43 AM