Vb.net 如何计算从列表框中选择项目时按下按钮的次数

Vb.net 如何计算从列表框中选择项目时按下按钮的次数,vb.net,Vb.net,列表框有三个候选项和一个记录按钮。每次点击记录按钮时,我都需要它为列表框中选中的每个候选人添加这些按钮点击。无论我在列表框中选择哪个候选人,我的代码都会不断计算所有点击次数。如何区分列表框中的每个选定项 下面是应用程序外观的图像: 应该是 candidatevotes(candListBox.SelectedIndex) += 1 及 应该是 markLabel.Text = candidatevotes(0) sheimaLabel.Text = candidatevotes(1) samL

列表框有三个候选项和一个记录按钮。每次点击记录按钮时,我都需要它为列表框中选中的每个候选人添加这些按钮点击。无论我在列表框中选择哪个候选人,我的代码都会不断计算所有点击次数。如何区分列表框中的每个选定项

下面是应用程序外观的图像:

应该是

candidatevotes(candListBox.SelectedIndex) += 1

应该是

markLabel.Text = candidatevotes(0)
sheimaLabel.Text = candidatevotes(1)
samLabel.Text = candidatevotes(2)

非常感谢你。我真的很感谢你的帮助。
candidatevotes(candListBox.SelectedIndex) += 1
markLabel.Text = total.ToString
sheimaLabel.Text = total.ToString
samLabel.Text = total.ToString
markLabel.Text = candidatevotes(0)
sheimaLabel.Text = candidatevotes(1)
samLabel.Text = candidatevotes(2)