Solved

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

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
make control visible based off other control value 7 45
VB.Net Data Class 1 48
Updating Printer Details in VB.Net 16 43
Convert a string to date 4 40
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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