Combo Box Improvement
-
Hello, I have a little problem, i am expecting a solution. I have a combobox loaded with data. I have to do some operations once the New item is selected. But i don't want to use selectedindex/value changed event, as this will change on any selection. Instead i want to perform the operation once the item is selected i.e. once the change is committed. The event is SelectionChangeCommitted. The problem with SelectionChangeCommitted is that this never fires in different cases like COmboBox is in drop mode and we are using keyboard arrow keys to select different items. Now when we click anywhere on the form the value is changed but this event is not fired! There are other cases like you are going through values in drop mode and then you press escape button. New Value is selected but again SelectionChangeCommitted is not fired. So Can anyone tell me the work around ? Waiting anxiously for some solution. Regards, Asim
-
Hello, I have a little problem, i am expecting a solution. I have a combobox loaded with data. I have to do some operations once the New item is selected. But i don't want to use selectedindex/value changed event, as this will change on any selection. Instead i want to perform the operation once the item is selected i.e. once the change is committed. The event is SelectionChangeCommitted. The problem with SelectionChangeCommitted is that this never fires in different cases like COmboBox is in drop mode and we are using keyboard arrow keys to select different items. Now when we click anywhere on the form the value is changed but this event is not fired! There are other cases like you are going through values in drop mode and then you press escape button. New Value is selected but again SelectionChangeCommitted is not fired. So Can anyone tell me the work around ? Waiting anxiously for some solution. Regards, Asim
Each firing event execute a subrutine in Visual Basic. In some cases when one event is firring and not the other which you want, You can fire it manualy by calling the subrutine that executes against that event which is to fired. If user selects with arrow keys. KeyUp event can be used to fire Click Event
Sub MyCombo1_KeyUp(KeyCode as Integer, Shift as Integer) If KeyCode = 38 or KeyCode = 40 then Call MyCombo1_Click End If End Sub
When user will press Up or Down keys, Click Event Functionality will also work. This is only the demonstration, you can manage it your self. Shoaib Nawaz -
Each firing event execute a subrutine in Visual Basic. In some cases when one event is firring and not the other which you want, You can fire it manualy by calling the subrutine that executes against that event which is to fired. If user selects with arrow keys. KeyUp event can be used to fire Click Event
Sub MyCombo1_KeyUp(KeyCode as Integer, Shift as Integer) If KeyCode = 38 or KeyCode = 40 then Call MyCombo1_Click End If End Sub
When user will press Up or Down keys, Click Event Functionality will also work. This is only the demonstration, you can manage it your self. Shoaib Nawaz