|
-
Aug 18th, 2006, 04:08 AM
#1
Thread Starter
Addicted Member
textwidth
hi there,
i have a form containing label controls, then i am saving its width and caption in an .ini file, then i have a Report Designer which has also a label control in which the caption of the label control will be passed, how would i know how many characters can i placed in the label control in my report designer. i was trying to use the textwidth method but it seems it's not returning the correct width..
thanks
alexis23
-
Aug 18th, 2006, 04:16 AM
#2
Re: textwidth
find out the text length...
-
Aug 18th, 2006, 04:23 AM
#3
Re: textwidth
textwidth can only return the width of a string, you can't determine the availible textwidth
VB Code:
If textwidth("this is a test") > Label1.width then ' too wide for label
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 18th, 2006, 07:01 AM
#4
Re: textwidth
MSDN: "Returns the width of a text string as it would be printed in the current font."
Just in case 
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
|