I have made this small application for employee salary calculation. I have added a checked list box where user can tick multiple checkboxes for choosing benefits. The program will check all the items checked and will add the values tick. How should i do this? So far I tried this but it doesn't work
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
int Sum = 0;
for (int i = 0; i < checkedListBox1.CheckedItems.Count; i++)
{
foreach (var item in checkedListBox1.)
{
Sum = Sum + Int32.Parse(checkedListBox1.CheckedItems.ToString());
}
}
//textBox5.Text = Convert.ToString(Sum);
}