我在 c# 中有一个 CheckListBox,并且每当更改框中的一个检查状态时,我都会尝试触发一个事件。该事件的目的是改变一些RichTextBox。
我有这段代码,但仅当其中一个复选框出于某种原因从选中变为未选中时才会触发事件。我试图弄清楚我的代码有什么问题但没有成功。任何帮助将不胜感激。
private void clbAllRooms_ItemCheck(object sender, ItemCheckEventArgs e)
{
//If the checkstate changed, update price
//It updates price only when the state turns from Checked to Uncheck
if (e.NewValue != e.CurrentValue)
Update_rtbPrice();
}