Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field width in database form
Message
 
To
17/09/1997 14:08:17
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00050439
Message ID:
00050691
Views:
43
>I have always used not proportional fonts ( Courier 10 ) in my FoxPro 2.6 forms; every fields in my Fox Forms accept only the number of Chars corresponding to the field width in the .dbf, and the width of the text box is calculated from a personal version of GENSCRN , the program that in Fox generate the source from the designed form :this width is exactly corresponding to the number of chars that is possible to write.
>Now that i'm using VB5 i have the problem of the width of the text box ( no problem for the max number of chars, there is the apposite property MaxLenght ) :for example i would write a simple program that read the MaxLenght property of my text boxes and calculate the Width property ( considering if i use Courier new 10, 8 or Courier 10 or whatever non proportional fonts that i need to use ).
>In other words if my user enter a Lastname of 20 char it should enter only 20 char and the text box contains only 20 chars.
>If someone could help me thank you very much in advance.

The maxlength property of the text box will limit the number of characters input to the control. Of course this is not automated based on the database field size... you could write a procedure to go through each of the bound text boxes and their associated fields, get the field width, then set the maxlength property on the form...
Previous
Reply
Map
View

Click here to load this message in the networking platform