chadmanvb
asked on
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This did it:
TextBox1.Text = DisplayText.Replace("\n", Environment.NewLine)
Any idea why?
TextBox1.Text = DisplayText.Replace("\n", Environment.NewLine)
Any idea why?
ASKER