I am creating a custom control that inherits from ComboBox. I need to determine when an item has been added to the ComboBox to perform my own checks. It doesn't matter if it's C # or Vb.NET, but I don't know how to do it.
I tried everything that I found on the Internet, including this thread , but the link in the response was disabled, and I did not guess what to do.
For example, this code in Vb.net:
Public Sub SomeFunc() Handles Items.CollectionChanged '.... End Sub
It states that the Items property is not defined with WithEvents .
The control does not use a BindingSource. I need a control to perform a custom action when adding an element. Elements are added directly to the .Items property with:
customComboBox.Items.Add("item");
Can this be done?
source share