the following code works except for one thing, it populates a list box vertically instead of horizontally. I have posted the code below, can someone tell me how to populate the list box horizontally? The text file contains data in the following format x/y/z and I want to show it in the list box as x y z then start a new row that follows the same format.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
String LB1String = "";
StreamReader objReader = new StreamReader("C:/Data.txt");
{
while (LB1String != null)
{
LB1String = objReader.ReadLine();
String[] txtData;
Char [] Delimiter = new Char []{'/'};
txtData = LB1String.Split(Delimiter, 4);
if ( txtData != null)
{
listBox1.
listBox1.Items.AddRange(txtData);
}
}
}
}
}