我将列表中的项目添加到CheckedListBox。我希望该框可以向用户显示该项目的友好名称,但在用户选择该项目时需要使用“秘密”实际值。在CheckedListBox中显示友好名称
foreach (string s in x)
{
checkedlistBox1.Items.Add(friendlyValue);
//Now how do I get this to have the real value?
}
的下拉菜单,我可以设置显示名称和ValueName的东西,并使用类似:
combobox1.Items.Add(new ComboBoxItem { friendlyValue = x, realValue = y });
我似乎不能用CheckedListBox做到这一点。
这是WinForms? WPF?网? –
实际上形式。 –
WinForms,对吧?因为在“表单”是指HTML表单。导致一些混淆。 :) –