moving to next line in multiline text box after reaching 70char

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prakashleo
    New Member
    • Dec 2006
    • 9

    moving to next line in multiline text box after reaching 70char

    hi to all
    I am using vb 6.0
    I want to move to the next line in the text box after reaching text length 70 characters can any one help me
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by prakashleo
    hi to all
    I am using vb 6.0
    I want to move to the next line in the text box after reaching text length 70 characters can any one help me
    Hi. If you set the multiline property of the textbox to true and set the width to accommodate 70 characters this will work.
    Good luck

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by willakawill
      Hi. If you set the multiline property of the textbox to true and set the width to accommodate 70 characters this will work.
      Note though, for this to work you would have to set the textbox to a non-proportional font so that the characters are all the same width.

      Even then, a fixed width like this can be hard to achieve, because Windows likes to do word-wrapping, so words will often jump down to the next line.

      Comment

      • prakashleo
        New Member
        • Dec 2006
        • 9

        #4
        thank u for ur reply
        how can i set the textbox to non-proportional font

        Comment

        • willakawill
          Top Contributor
          • Oct 2006
          • 1646

          #5
          Originally posted by prakashleo
          thank u for ur reply
          how can i set the textbox to non-proportional font
          Killer means something like Courier New.
          Unless you need the textbox to be exactly 70 characters across this is not important.

          Comment

          • prakashleo
            New Member
            • Dec 2006
            • 9

            #6
            Originally posted by willakawill
            Killer means something like Courier New.
            Unless you need the textbox to be exactly 70 characters across this is not important.
            ya i tried it now and it works thank u
            and one more thing i am going to save this in ms access database before that i have to validate wheather each lines ended with comma or fullstop in that textbox because i have to cut the lines with less than or equal to 70 characters and it should be meaning full.
            please help me to do this
            thank u

            Comment

            • prakashleo
              New Member
              • Dec 2006
              • 9

              #7
              ya i tried it now and it works thank u
              and one more thing i am going to save this in ms access database before that i have to validate wheather each lines ended with comma or fullstop in that textbox because i have to cut the lines with less than or equal to 70 characters and it should be meaning full.
              please help me to do this
              thank u

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Originally posted by prakashleo
                ya i tried it now and it works thank u
                and one more thing i am going to save this in ms access database before that i have to validate wheather each lines ended with comma or fullstop in that textbox because i have to cut the lines with less than or equal to 70 characters and it should be meaning full.
                please help me to do this
                I think this is going to be more complicated than you expect.

                So far you have not done anything to the text. Setting the width of the textbox, and the font, only affects how it is shown on the screen - there are no "line breaks" in the text (you can demostrate this by using Debug.Print to print the text to the immediate window). So it will be tough to work out where you want the commas or full stops.

                It sounds as though you might have to independently re-create the word wrapping code, or something.

                Comment

                Working...