I’m trying to copy the selected item’s filename and its path to the clipboard and then a textbox from a listview. I can’t seem to get this one to work how i want. Here’s the code I’ve been playing around with.
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listView1.Items.Count > 0)
{
listView1.Items[0].Selected = true;
Clipboard.SetDataObject(this.listView1.SelectedItems[0]);
textBox1.Paste();
}
}
Can someone get me on the right track?
1 Answer