Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How do u make a newline in an text box?

How do u make a newline in an text box?

Scheduled Pinned Locked Moved Visual Basic
csharpc++question
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    devvvy
    wrote on last edited by
    #1

    How do u make a new line in text box programmatically in VB.NET? I was hoping to use C++ format code "\n": For i = 0 To (Count - 1) Step 1 txtMsgBox.Text = txtMsgBox.Text.Concat("\n" & lstContactList.SelectedItems(i).Text & txtMsg.Text) Next i But no, it didnt work. Thanx norm

    H B 2 Replies Last reply
    0
    • D devvvy

      How do u make a new line in text box programmatically in VB.NET? I was hoping to use C++ format code "\n": For i = 0 To (Count - 1) Step 1 txtMsgBox.Text = txtMsgBox.Text.Concat("\n" & lstContactList.SelectedItems(i).Text & txtMsg.Text) Next i But no, it didnt work. Thanx norm

      H Offline
      H Offline
      Hesham Amin
      wrote on last edited by
      #2

      You can use : txtMsgBox.Text=txtMsgBox.Text+ vbCrLf + "NewString" as vbCrLf = \n in VB make sure that : txtMsgBox.MultiLine=True

      J 1 Reply Last reply
      0
      • H Hesham Amin

        You can use : txtMsgBox.Text=txtMsgBox.Text+ vbCrLf + "NewString" as vbCrLf = \n in VB make sure that : txtMsgBox.MultiLine=True

        J Offline
        J Offline
        Jason Gerard
        wrote on last edited by
        #3

        Actually vbCrLf = \r\n, Carriage Return (Cr), Line Feed (Lf) vbCr = \r vbLf = \n Jason Gerard

        1 Reply Last reply
        0
        • D devvvy

          How do u make a new line in text box programmatically in VB.NET? I was hoping to use C++ format code "\n": For i = 0 To (Count - 1) Step 1 txtMsgBox.Text = txtMsgBox.Text.Concat("\n" & lstContactList.SelectedItems(i).Text & txtMsg.Text) Next i But no, it didnt work. Thanx norm

          B Offline
          B Offline
          Bo Hunter
          wrote on last edited by
          #4

          Try CrLf Carriage Return and Line Feed characters. use one every time you want to start a new line.:)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups