Right now my code takes the entire text file and just places it all into one text box. What I am trying to figure out how to do is have it place each line of the file into each separate text box.
namespace HomeInventory2
{
public partial class Form1 : Form
{
public Form1(string prepopulated)
{
InitializeComponent();
textBoxAmount.Text = prepopulated;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void submitButton_Click(object sender, EventArgs e)
{
CreateInventory create = new CreateInventory();
create.ItemAmount = textBoxAmount.Text;
create.ItemCategory = textBoxCategories.Text;
create.ItemProperties = textBoxValue.Text;
create.ItemValue = textBoxValue.Text;
InventoryMngr invtryMngr = new InventoryMngr();
invtryMngr.Create(create);
}
}
Assuming that the order of the lines is always the same and that each
TextBoxbelongs to a line:Enumerable.ElementAtOrDefault<TSource>Method