You can use the ListBoxItem.ForeColor and UseItemStyleForSubItems properties to make the item look dimmed. Use SystemColors.GrayText to pick the theme color for disabled items. Avoid disabling selection, it prevents the user from using the keyboard. Only disable the checkbox checking. For example:
private void listView1_ItemCheck(object sender, ItemCheckEventArgs e) {
// Disable checking odd-numbered items
if (e.Index % 2 == 1) e.NewValue = e.CurrentValue;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…