【发布时间】:2014-10-14 19:00:32
【问题描述】:
我可以在单击按钮时将列表框中的多个选定项目显示到文本框中,但是如何在消息框上显示相同的项目?我的意思是在消息框上显示第一个项目不是问题,但同时显示多个项目是。请提出建议...
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
Skill = checkedListBox1.SelectedItem.ToString();
if (e.NewValue == CheckState.Checked)
{
listBox1.Items.Add(Skill);
}
else
{
listBox1.Items.Remove(Skill);
}
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("You have selected following Skills : \n"+Skill, "Selected Skills",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
【问题讨论】:
标签: c# visual-studio-2008 listbox checkboxlist