|
-
Jul 29th, 2003, 08:16 AM
#1
Textwidth question
How can I know the width of a string for a specific fontsize, fonttype etc?
-
Jul 29th, 2003, 08:34 AM
#2
Re: Textwidth question
Originally posted by krtxmrtz
How can I know the width of a string for a specific fontsize, fonttype etc?
using the printer object if you set the font and then use the printer.textwidth method... that should do it for ya
-
Jul 29th, 2003, 10:35 AM
#3
So Unbanned
Picture boxes also support .TextWidth.
Probably even the Form.
-
Jul 29th, 2003, 10:38 AM
#4
Originally posted by DiGiTaIErRoR
Picture boxes also support .TextWidth.
Probably even the Form.
yeah form does as well.. i suggested the printer object because it is built in and you can change the font without it affecting your form or anything... but if you can use form i would recommend that... as i found out the hard way.. calls to the printer object will fail if windows doens't have a printer installed
-
Jul 31st, 2003, 05:13 AM
#5
Addicted Member
What you mean?
I don't really get what you mean.
But i know how to make a label/textbox roughy the same lenght as the text.
First, fontname is fixedsys.
then:
info.width = Len(info2.Caption) * 125
I learn this while creating WWP
Unignal Software Team Developer
-------------------------------------------
Current Project:
Noter Light
-------------------------------------------
http://www.unignal.sg.tf
-
Jul 31st, 2003, 05:22 AM
#6
Frenzied Member
set the font first for info and info2 then
VB Code:
info.width = TextWidth(Info2.Caption)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|