Solved

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

Posted on 2013-01-29
3
281 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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