How to output text in textbox in different lines

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sherwinsalazar
    New Member
    • Jan 2014
    • 2

    #1

    How to output text in textbox in different lines

    i tried to write this code but it only output the last value

    details.text="M odel/Make :"
    details.text="S erial No :"
    details.text="M otor No :"
    details.text="P late No:"

    but it only output Plate No:, the output that i want in a text are this

    Model/Make :
    Serial No :
    Motor No :
    Plate No :

    i hope you could help me with my problem, thanks
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    The problem that is each line is replacing the last, you need to append to the original value.

    Comment

    • sherwinsalazar
      New Member
      • Jan 2014
      • 2

      #3
      how will i do it sir? can you please give the code to do that, thank you in advance

      Comment

      • Luk3r
        Contributor
        • Jan 2014
        • 300

        #4
        I don't know much about vb6, but in vb.net you could do it this way:

        Code:
        details.text = "Model/Make :" + vbCrLf
        details.text = details.text + "Serial No :" + vbCrLf
        details.text = details.text + "Motor No :" + vbCrLf
        details.text = details.text + "Plate No:"
        vbCrLf stands for Visual Basic Carriage Return Line Feed. Basically, like hitting enter on your keyboard while writing in a text document. The reason that we say details.text = details.text + **string** is to include what details.text used to be, and "append" to it, essentially.

        Comment

        Working...