Multi-Line Textbox limits 
Author Message
 Multi-Line Textbox limits

Greetings.

Is anybody able to effectively limit the number of characters per line
and the number of lines entered into a multi-line textbox?

I know about the CurLine and LineCount properties but have so far been
unable to put something together which effectively stops extra lines
being added.  (I've tried undoaction, but just get a runtime error!
And if it did work, it would loose all the entries rather than just
the final line)

Is there a way of limiting the number of lines allowed without writing
code into a change event?

The same goes for the characters per line.  Through a few experiments
I've managed to stop entry using the CurX property of the textbox, but
this doesn't (to me at least) appear to be an ideal method.

Thanks for any input on this.

Daren



Tue, 10 Sep 2002 03:00:00 GMT  
 Multi-Line Textbox limits
Hi Darren,

Quote:
> Is anybody able to effectively limit the number of characters per line
> and the number of lines entered into a multi-line textbox?

To limit the number of characters per line, you could set the font of the
textbox to a fixed-width font like Courier New. This way, all characters
take up the same horizontal space. Then, to limit the number of characters
per line, you would just need to experiment a little with the width of the
textbox.

To limit the number of lines, you would then set the MaxLength property of
the textbox to:

            CharactersPerLine * NoOfAllowableLines

eg: If you have set the width of the textbox to accommodate 30 characters
and you want to allow only 6 lines, you would set the MaxLength property to
180.

--
Hope this helps.
Regards
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.



Thu, 12 Sep 2002 03:00:00 GMT  
 Multi-Line Textbox limits

Quote:

>Hi Darren,

>> Is anybody able to effectively limit the number of characters per line
>> and the number of lines entered into a multi-line textbox?

>To limit the number of characters per line, you could set the font of the
>textbox to a fixed-width font like Courier New. This way, all characters
>take up the same horizontal space. Then, to limit the number of characters
>per line, you would just need to experiment a little with the width of the
>textbox.

>To limit the number of lines, you would then set the MaxLength property of
>the textbox to:

>            CharactersPerLine * NoOfAllowableLines

>eg: If you have set the width of the textbox to accommodate 30 characters
>and you want to allow only 6 lines, you would set the MaxLength property to
>180.

>--
>Hope this helps.
>Regards
>ibby

>Please post replies or follow-ups to the **newsgroup** so that participants
>may benefit or contribute.

Thanks for pointing out what I should have obviously thought of!  

 As usual, I was trying to be too clever by half!

Daren



Sat, 14 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Multiline Textboxes - Limiting Characters Per Line

2. multiline textbox limit

3. multiline textbox limit

4. Limit a multi-line textbox to 10 lines ?

5. HELP:limiting # of lines in a Multiline Textbox

6. Line limit in Multiline Textbox

7. Limit Size of Multi-line Textbox

8. Read a MultiLine textbox line by line?

9. Limitting line length of each line within multiline textbox

10. No of lines in a multi line TextBox ?

11. Limiting X number of lines in TextBox

12. Limiting X number of lines in TextBox

 

 
Powered by phpBB® Forum Software