• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

missing line breaks in a form popup visual basic with a multiline textbox

I use a form as a pop.  I pass some test to display on the form.  If I use a label, it looks correct.  When I use a multiline textbox it strings all the text together without line breaks.  How can I fix this?  

Public Sub New(ByVal DisplayText As String)
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call


        strFormText = DisplayText

        TextBox1.Text = DisplayText
        Label1.Text = strFormText

       
         End Sub
0
chadmanvb
Asked:
chadmanvb
  • 2
1 Solution
 
CodeCruiserCommented:
What does DisplayText contain for line breaks? Is it just LF or CRLF? Where does it come from?
0
 
chadmanvbAuthor Commented:
It's output from a linux server.  I have the linux server run unix2dos command before it's passed to my application.  The display looks fine on the label for the popup, but does not work for the textbox.  I just thought they would work the same.  I was hopping to use a mutiline textbox so I could use a scroll bar if needed.
0
 
chadmanvbAuthor Commented:
This did it:


 TextBox1.Text = DisplayText.Replace("\n", Environment.NewLine)

Any idea why?
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now