Well for want of a better solution, this works:
GetTextWidth("Period","Tahoma",8) returns 32
Function GetTextWidth
Parameters tcText, tcFontName, tnFontSize
Local x As Form
Local lnRetVal
x = CREATEOBJECT("Form")
With x
.AddObject("Label","Label")
With .Label
.FontName = tcFontName
.FontSize = tnFontSize
.AutoSize = .T.
.Visible = .T.
.Caption = tcText
EndWith
EndWith
lnRetVal = x.Label.Width
x = .NULL.
Release x
Return lnRetVal
----- Original Message -----
From: "Paul Newton" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: 29 September 2008 15:11:23 o'clock (GMT) Europe/London
Subject: Re: Calculating text width
Ted
I don't necessarily consider one or the other to be "more correct" - but I
would like a way of calculating the width in such a way that the result is
consistent with what AutoSize yields ...
Paul
----- Original Message -----
From: "Ted Roche" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: 29 September 2008 15:06:31 o'clock (GMT) Europe/London
Subject: Re: Calculating text width
On Mon, Sep 29, 2008 at 8:56 AM, Paul Newton <[EMAIL PROTECTED]> wrote:
> Is there a way to more accurately calculate the width of the label ?
Which answer to you consider more correct? Why?
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.