Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate textbox width
Message
From
30/04/2003 09:35:07
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00783078
Message ID:
00783126
Views:
14
Pete,

Doesn't make sense to do this at design time if you use a proportional font (like most of them are).

If you use a fixed font (eg Courier New) then I guess it is just the char width * #chars + space for the margin + something else

You can use a builder, your calculator or - recommended - a few statements in the init() of the textbox, which adjust the width of the textbox once

Also possible is the code I provided in the InteractiveChange ( on this.Value and not on rtrim(this.Value))

In short, you can only set the width for a 35 char field if, and only if, you use a non-proportional font.

But then, is it worth all the trouble. If people complain, explain that you use a proportional font which looks nicer. They'll understand.

>Hello Gregory,
>I can think of a use for your, however what I require right now is to set the width of the textbox at design time to the underlying width of the ControlSource
>
>
>e.g.
>mycontrolsourcefield is 35 chars
>what width should I set the textbox ?, I guess what I need to do is figure it out and write a builder.
>
>thanks for your time
>
>regards
>
>Pete Kane
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform