Solved

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

Posted on 2013-01-29
3
291 Views
Last Modified: 2013-01-29
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
Comment
Question by:chadmanvb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 38832814
What does DisplayText contain for line breaks? Is it just LF or CRLF? Where does it come from?
0
 

Author Comment

by:chadmanvb
ID: 38832831
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
 

Author Closing Comment

by:chadmanvb
ID: 38832860
This did it:


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

Any idea why?
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question