简体   繁体   中英

Raise Event When ListBox range is Changed

I have a ListBox that is always populated by first calling ListBox.Items.Clear() then calling ListBox.Items.AddRange(num);

Is there an event that is raised every time the range is changed?

(I saw similar questions to this, but as they pertained to more of the selected index, the proposed solutions do not help me. My list box isn't selectable)

I don't believe there is an event for this. But you can create a subclass of your listbox class and override the AddRange method to call your new event that you create to handle this (and then call the base classes addRange method).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM