0

I have a little problem. When I click the button, I want the ListView to move to the next object. Also, when it moves to the new object, it needs to get the address of the new object.

The program will switch to the new picture in the ListView every time the save button is clicked.

enter image description here

button click codes:

                    
int next=Convert.ToInt32(listView1.FocusedItem.Index) + 1;
                    
listView1.Items[next].Selected = true;

degisken = secilen.SubItems[sayac].Text;

listbox1 SelectedIndexChanged codes:


private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
    secilen = listView1.FocusedItem;
            
    degisken = secilen.SubItems[sayac].Text;

    pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;

    string alan = degisken;
    pictureBox1.ImageLocation = yol + "/" + alan;
}

The program will switch to the new picture in the listview every time the save button is clicked.

4
  • What buttons are there? Do you want the action to happen on the Save button? What is the other button? Are you sure that the code in under the correct button? Commented Dec 13, 2022 at 13:39
  • Yes , code inside is save button Commented Dec 13, 2022 at 21:20
  • What is not working? Commented Dec 14, 2022 at 9:26
  • When I press the save button, it does not move to the next listView1 item. Commented Dec 14, 2022 at 12:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.