I have a combobox in a custom control. How can I expose specific events from it such as SelectedIndexChanged or KeyPress, etc to anyone/thing implementing my custom control?
You can forward the events like this:
public event EventHandler SelectedIndexChanged { add { inner.SelectedIndexChanged += value; } remove { inner.SelectedIndexChanged -= value; } }
1.4m articles
1.4m replys
5 comments
57.0k users