Combobox events
-
Hi, I was wondering if anyone out there might be able to help me with the removal of the selectedindexchanged event from a custom combobox? I have created a custom combobox control and have the keyevents calling a method that will reset the selectedIndex changed event to 0, and then to -1. I do this because visual studio 2003 seems to have problems setting the combobox index to -1. In that method, I need to shut down the index changed event so that the event is activated only once when the index is changed, but I do not know how exactly I can remove the handler/disable the event within a custom control that inherits from the combobox. Anyhelp would be greatly appreciated. Thank you and have a nice day. Code: -not working 'delegate declaration? Shadows Event SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) 'Handling event Protected Overrides Sub OnSelectedIndexChanged(ByVal e As System.EventArgs) MyBase.OnSelectedIndexChanged(e) End Sub 'Reset Index Public Sub resetIndex() RemoveHandler SelectedIndexChanged, AddressOf OnSelectedIndexChanged Me.SelectedIndex = 0 AddHandler SelectedIndexChanged, AddressOf OnSelectedIndexChanged Me.SelectedIndex = -1 End Sub eatwork eatwork