private void BtnUngrasp_Click(object sender, EventArgs e) { for (int i = 0; i < LbxWord.SelectedItems.Count; i++) { WordDataHelper.AddWordData(LbxWord.SelectedItems[i].ToString(), 1); WordDataHelper.AutoSubtractProgress(LbxWord.SelectedItems[i].ToString()); } }
private void BtnGrasp_Click(object sender, EventArgs e) { for (int i = 0; i < LbxWord.SelectedItems.Count; i++) { WordDataHelper.AddWordData(LbxWord.SelectedItems[i].ToString(), 0); WordDataHelper.AutoAddProgress(LbxWord.SelectedItems[i].ToString()); } for (int i = 0; i < LbxWord.Items.Count; i++) { if (LbxWord.GetSelected(i)) { LbxWord.Items.RemoveAt(i); transList.RemoveAt(i); i--; } } }