Hey guys, i figured out how to add items to a listbox one line at a time:
try
{
if (nameTxtbox.Text == "")
throw new Exception();
listBox1.Items.Add(nameTxtbox.Text);
nameTxtbox.Text = "";
textBox1.Text = "";
nameTxtbox.Focus();
}
catch(Exception err)
{
MessageBox.Show(err.Message, "Enter something into the txtbox", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
But I wont to be able to add multiple items to the same line. Like have first_name | last_name | DoB all on the same line. When I do
listBox1.Items.Add(last_name.Text);
It adds the last name to a new line on the listbox, I need to add it to the same line as the first name.