I want to delete some parts (string or int values) for selected listbox item in C#.
As shown on picture I get some random coordinates on picturebox which is shown on Listbox1. Then I selected randomly these points to add Listbox2 by ADD button. I want make new arrangement at Listbox2 which means it should be 1.selected point 2.3.4.selected points ..(not randomly 3.rd 6.th 7.th ..)
Secondly I want to transfer to coordinate (just numbers) to Listbox3. How can I do?
(source: hizliresim.com)
To add selected coordinate
private void add()
{
int c = listBox1.Items.Count - 1;
for (int i = c; i >= 0; i--)
{
if (listBox1.GetSelected(i))
{
int a = listBox2.Items.Count + 1;
listBox2.Items.Add(a+" "+listBox1.Items[i]);
// listBox1.Items.RemoveAt(i);
}
}
}