0
Reply

Override the click event of Combo box

niharika.reddy

niharika.reddy

Oct 16 2004 2:40 AM
2.2k
I want to override the default functionality of click event.As I click on combo box it gets drop down.But I want to check out that depending on certain condition,it should get dropped down and not always. For this I have overrided the method OnClick of Combo box as follows Protected Overrides Sub OnClick(ByVal e As System.EventArgs) If Combox1.DroppedDown = False Then Combox1.DroppedDown = True End If End Sub But when I click on Combo box it changes the back color to blue but if it is dropped down still it gets drop down twice as I have written code on Enter event that Combox1.DroppedDown = True as my requirement is that when I came to Combo box by pressing Tab key,it should get dropped down which is working fine when I press tab and comes on combo box. But when I directly clicks on combox,it calls enter event also and then calls click event.Because of that it gets dropped twice thats why I want to override the default functionality of click event that if the combo box is not drop down then only drop down the combo box.So I have overrided the onclick method of combo box.But still It is getting drop twicely. Please advice on the same as it is very urgent