Limit edit box

I have a issue with an fox app where I need to limit a editbox to no more then 3 lines of 40 characters. three text box controls will not provide the word-wrap support I am looking for.. Is there away to do this

chris krelle




Answer this question

Limit edit box

  • TheCurse

    Actually the MaxLength property deals with the TOTAL number of characters so 3*40 will be 120 characters total. That could be 120 characters on 1 line or 1 character on 120 lines. Unless all of the Carrage Returns are stripped there is no way to control the number of lines.

    I have made modifications to my Editbox to limit input to a given width and number of lines. However the number of characters on a line has to be related to the Font and width of the EditBox in order to limit the number of lines. My soultion uses the Valid of the EditBox to test the width and number of lines. All the EditBoxes and any output needs to be sized to match if it needs to have the same "look" of 3 X 40.

    Dennis


  • hakito

    I'm a little late in responding, however, why not use the interactivechange event. This will give you complete control of what's typed.
  • CodeAnger

    Use additems() to add the records you want in the size you need. You can decide how many records are added easily this way.

    Look in help under additems and combo and list boxes.



  • sweetnlowe

    Don,

    Thank you, however from what I see this would be good for displaying text. I need the edit box for input.. I have a deparment that adds text in to the middle of several lines of text. This causes the current text to word wrap and can in many cases end up with 4 or 5 line of text in the display... I find the same result with setting the maxlength... I think I need a way of turning off the word wrap so that it only scrolls the single character at end of line and not the entire word.

    Thanks to all,

    Chris Krelle



  • qsnet

    I ended up using the keypress event of three text boxes. and manualy controled the scrolling of the text!

    Thank you to all.. Every one was a help.. :)

    Chris Krelle



  • ThomaWe

    myEditbox.MaxLength = 3*40
  • Limit edit box