[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Newline in listbox

Posted on 2009-03-31
2
Medium Priority
?
745 Views
Last Modified: 2012-08-13
Hi,
How can I make a newline in a listbox?

I get a strange sign in my text box when I use:
\n
and also when I use
Enviorment.newline.

I ad to listbox like this:
listBox2.Items.Add(output);

0
Comment
Question by:Mickeys
[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 Comments
 
LVL 6

Assisted Solution

by:HarryNS
HarryNS earned 600 total points
ID: 24026978
Text box and List box are two different controls with different behaviours and purpose.

In text box, the whole content is text... Whether one line or multiple... Completely its single string information.

But In List box, each line is called list item... Each item itself is an object having its own behaviour...
0
 
LVL 4

Accepted Solution

by:
amazingwolf1 earned 1400 total points
ID: 24026998
In a list box, do this:
listBox.Items.Add("1");
listBox.Items.Add("");
listBox.Items.Add("2");

as for the textbox:
txt.TextMode = TextBoxMode.MultiLine; // determine its has more then one row
txt.Text = "First row\r\nsecond Row"; // use /r/n  to open a new line

HTH

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

656 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