I would like remove item just before because its shows me twice the same item when I click on, but here, item number -1 doesn't exists And I don't know why. How I can resolve this ? Thank you.
private void DEXTarget_CheckedChanged(object sender, EventArgs e)
{
Logs("DEX(TMAPI) Target Checked");
listView1.Items.RemoveAt(-1);
PS3.ChangeAPI(SelectAPI.TargetManager);
Var.API = true;
}
private void CEXTarget_CheckedChanged(object sender, EventArgs e)
{
Logs("CEX(CCAPI) Target Checked");
PS3.ChangeAPI(SelectAPI.ControlConsole);
Var.API = false;
}
Log:
private void Logs(string text)
{
Var.lst = this.listView1.Items.Add(DateTime.Now.ToString("dd/MM/yy HH:mm"));
Var.lst.SubItems.Add(text);
}
ListViewItemCollection.RemoveAtwill throughArgumentOutOfRangeExceptionif index is less than 0.