Q:

How to save ListView selected item

I'm trying to save a ListView selected item and I don't know why I'm getting this error:

"Cannot implicitly convert type 'int' to
  'System. Windows. Forms. ListView. SelectedListViewItemCollection'"

I tried this code on the save button:
Settings. Default["SelectedDevice"] = sourceList. SelectedItems; //Works fine

on Form_Load I tried this:
sourceList. SelectedItems = (int)Settings. Default["SelectedDevice"]; //error

A:

I've made a small application where I read the selecteditem from the settings.  The code to select the Item in the OnLoad-Event is:
 private void OnLoad(object sender, EventArgs eventArgs)
 {
    int selectedItem = Properties. Settings. Default. SelectedItem;
    if (selectedItem ! = -1)
    {
       this.listView1.Items[selectedItem].Selected = true;
    }
  }

The Default-Value of my Settings is -1

