For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > August 2005 > how to get the string length in points?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to get the string length in points?
LenZ

2005-08-26, 6:55 pm

I want to set the "columnwidth" of my multi-column "Listbox", and I know I
have to set "columnwidth" to a string like "50;60;70" in which all numbers
are in "point", But I'm wondering how to calculate the length of a string in
points? ANy reply will be greatly appreciated. Thanks.
alpine

2005-08-26, 6:55 pm

On Fri, 26 Aug 2005 10:36:03 -0700, "LenZ"
<LenZ@discussions.microsoft.com> wrote:

>I want to set the "columnwidth" of my multi-column "Listbox", and I know I
>have to set "columnwidth" to a string like "50;60;70" in which all numbers
>are in "point", But I'm wondering how to calculate the length of a string in
>points? ANy reply will be greatly appreciated. Thanks.



Have a look at the TextWidth, ScaleX and ScaleY methods in your VB
help file.

HTH,
Bryan
________________________________________
____________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
LenZ

2005-08-29, 6:55 pm

Sorry, alpine, I'm using VBA now, there is no ScaleX and ScaleY methods. Any
other idea? thanks.
--
LenZ


"alpine" wrote:

> On Fri, 26 Aug 2005 10:36:03 -0700, "LenZ"
> <LenZ@discussions.microsoft.com> wrote:
>
>
>
> Have a look at the TextWidth, ScaleX and ScaleY methods in your VB
> help file.
>
> HTH,
> Bryan
> ________________________________________
____________________
> New Vision Software "When the going gets weird,"
> Bryan Stafford "the weird turn pro."
> alpine_don'tsendspam@mvps.org Hunter S. Thompson -
> Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
>

LenZ

2005-08-29, 6:55 pm

hi, alpine, thanks for your reply.
But I'm using VBA now, there is no ScaleX, ScaleY methods. Do you know any
other way? Thank you very much.
--
LenZ


"alpine" wrote:

> On Fri, 26 Aug 2005 10:36:03 -0700, "LenZ"
> <LenZ@discussions.microsoft.com> wrote:
>
>
>
> Have a look at the TextWidth, ScaleX and ScaleY methods in your VB
> help file.
>
> HTH,
> Bryan
> ________________________________________
____________________
> New Vision Software "When the going gets weird,"
> Bryan Stafford "the weird turn pro."
> alpine_don'tsendspam@mvps.org Hunter S. Thompson -
> Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
>

Michael Cole

2005-08-29, 9:55 pm

[Adjusted to fix top-posting]


LenZ wrote:[color=darkred]
> Sorry, alpine, I'm using VBA now, there is no ScaleX and ScaleY
> methods. Any other idea? thanks.


You may then wish to ask this question in a VBA newsgroup. Whilst VB does
include VBA, VBA is only a subset of VB. Depending upon which Office
package you are using, there are newsgroups for various forms of VBA here.


--
Regards,

Michael Cole


Karl E. Peterson

2005-08-29, 9:55 pm

LenZ wrote:
>
> Sorry, alpine, I'm using VBA now, there is no ScaleX and ScaleY
> methods. Any other idea? thanks.


Sounds like you need to use GetTextExtentPoint32.
--
Working Without a .NET?
http://classicvb.org/petition


Tony Proctor

2005-08-30, 7:55 am

Not sure whether this is useful in VBA Lenz since I haven't used that much,
but it's worth a visit. The code at this link shows how to size a multi-line
piece of text for a specific control:
http://groups.google.ie/group/micro...33b01e683?hl=en

Tony Proctor

"LenZ" <garyzhou26@hotmail.com> wrote in message
news:8A087329-5D6C-4BAB-90D7-889AB563BFCC@microsoft.com...[color=darkred]
> hi, alpine, thanks for your reply.
> But I'm using VBA now, there is no ScaleX, ScaleY methods. Do you know any
> other way? Thank you very much.
> --
> LenZ
>
>
> "alpine" wrote:
>
know I[color=darkred]
numbers[color=darkred]
string in[color=darkred]


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com