I have listbox that I populate with data from a text file..
I select an item and populate a textbox(txtFileText) with the item I selected...I want to be able to modify the data and then update the list with the btnUpdLst_Click
I was able to do this in VB .net...but unable to do so in C #...
private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
txtFileText.Text = listBox1.SelectedItem.ToString();
j = listBox1.SelectedItem.ToString();
j2 = listBox1.SelectedIndex; }
private void btnUpdLst_Click(object sender, System.EventArgs e)
{
listBox1.Items[j2] = txtFileText.Text;
}
I select an item and populate a textbox(txtFileText) with the item I selected...I want to be able to modify the data and then update the list with the btnUpdLst_Click
I was able to do this in VB .net...but unable to do so in C #...
private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
txtFileText.Text = listBox1.SelectedItem.ToString();
j = listBox1.SelectedItem.ToString();
j2 = listBox1.SelectedIndex; }
private void btnUpdLst_Click(object sender, System.EventArgs e)
{
listBox1.Items[j2] = txtFileText.Text;
}